Added built-in IO-Register symbols

This commit is contained in:
Lior Halphon 2017-02-20 14:37:15 +02:00
parent 91513ced22
commit b0dfb8c5ac
4 changed files with 77 additions and 3 deletions

View File

@ -369,6 +369,7 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height,
}
GB_load_rom(&gb, [fileName UTF8String]);
GB_load_battery(&gb, [[[fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sav"] UTF8String]);
GB_debugger_load_symbol_file(&gb, [[[NSBundle mainBundle] pathForResource:@"registers" ofType:@"sym"] UTF8String]);
GB_debugger_load_symbol_file(&gb, [[[fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"sym"] UTF8String]);
return YES;
@ -1175,4 +1176,4 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height,
}];
}
@end
@end

View File

@ -85,7 +85,7 @@ endif
cocoa: $(BIN)/SameBoy.app
quicklook: $(BIN)/SameBoy.qlgenerator
sdl: $(SDL_TARGET) $(BIN)/sdl/dmg_boot.bin $(BIN)/sdl/cgb_boot.bin $(BIN)/sdl/LICENSE
sdl: $(SDL_TARGET) $(BIN)/sdl/dmg_boot.bin $(BIN)/sdl/cgb_boot.bin $(BIN)/sdl/LICENSE $(BIN)/sdl/registers.sym
bootroms: $(BIN)/BootROMs/cgb_boot.bin $(BIN)/BootROMs/dmg_boot.bin
tester: $(TESTER_TARGET) $(BIN)/tester/dmg_boot.bin $(BIN)/tester/cgb_boot.bin
all: cocoa sdl tester
@ -150,6 +150,7 @@ $(BIN)/SameBoy.app: $(BIN)/SameBoy.app/Contents/MacOS/SameBoy \
$(shell ls Cocoa/*.icns) \
Cocoa/License.html \
Cocoa/Info.plist \
Misc/registers.sym \
$(BIN)/SameBoy.app/Contents/Resources/dmg_boot.bin \
$(BIN)/SameBoy.app/Contents/Resources/cgb_boot.bin \
$(BIN)/SameBoy.app/Contents/Resources/Base.lproj/Document.nib \
@ -158,7 +159,7 @@ $(BIN)/SameBoy.app: $(BIN)/SameBoy.app/Contents/MacOS/SameBoy \
$(BIN)/SameBoy.qlgenerator \
Shaders
$(MKDIR) -p $(BIN)/SameBoy.app/Contents/Resources
cp Cocoa/*.icns $(BIN)/SameBoy.app/Contents/Resources/
cp Cocoa/*.icns Misc/registers.sym $(BIN)/SameBoy.app/Contents/Resources/
sed s/@VERSION/$(VERSION)/ < Cocoa/Info.plist > $(BIN)/SameBoy.app/Contents/Info.plist
cp Cocoa/License.html $(BIN)/SameBoy.app/Contents/Resources/Credits.html
$(MKDIR) -p $(BIN)/SameBoy.app/Contents/Resources/Shaders
@ -259,6 +260,9 @@ $(BIN)/SameBoy.app/Contents/Resources/%.bin: $(BOOTROMS_DIR)/%.bin
$(BIN)/sdl/LICENSE: LICENSE
cp -f $^ $@
$(BIN)/sdl/registers.sym: Misc/registers.sym
cp -f $^ $@
# Boot ROMs
$(BIN)/BootROMs/%.bin: BootROMs/%.asm

67
Misc/registers.sym Normal file
View File

@ -0,0 +1,67 @@
00:FF00 IO_JOYP
00:FF01 IO_SB
00:FF02 IO_SC
00:FF04 IO_DIV
00:FF05 IO_TIMA
00:FF06 IO_TMA
00:FF07 IO_TAC
00:FF0F IO_IF
00:FF10 IO_NR10
00:FF11 IO_NR11
00:FF12 IO_NR12
00:FF13 IO_NR13
00:FF14 IO_NR14
00:FF16 IO_NR21
00:FF17 IO_NR22
00:FF18 IO_NR23
00:FF19 IO_NR24
00:FF1A IO_NR30
00:FF1B IO_NR31
00:FF1C IO_NR32
00:FF1D IO_NR33
00:FF1E IO_NR34
00:FF20 IO_NR41
00:FF21 IO_NR42
00:FF22 IO_NR43
00:FF23 IO_NR44
00:FF24 IO_NR50
00:FF25 IO_NR51
00:FF26 IO_NR52
00:FF30 IO_WAV_START
00:FF3F IO_WAV_END
00:FF40 IO_LCDC
00:FF41 IO_STAT
00:FF42 IO_SCY
00:FF43 IO_SCX
00:FF44 IO_LY
00:FF45 IO_LYC
00:FF46 IO_DMA
00:FF47 IO_BGP
00:FF48 IO_OBP0
00:FF49 IO_OBP1
00:FF4A IO_WY
00:FF4B IO_WX
00:FF4C IO_DMG_EMULATION
00:FF4D IO_KEY1
00:FF4F IO_VBK
00:FF50 IO_BIOS
00:FF51 IO_HDMA1
00:FF52 IO_HDMA2
00:FF53 IO_HDMA3
00:FF54 IO_HDMA4
00:FF55 IO_HDMA5
00:FF56 IO_RP
00:FF68 IO_BGPI
00:FF69 IO_BGPD
00:FF6A IO_OBPI
00:FF6B IO_OBPD
00:FF6C IO_DMG_EMULATION_INDICATION
00:FF70 IO_SVBK
00:FF72 IO_UNKNOWN2
00:FF73 IO_UNKNOWN3
00:FF74 IO_UNKNOWN4
00:FF75 IO_UNKNOWN5
00:FF76 IO_PCM_12
00:FF77 IO_PCM_34
00:FF7F IO_UNKNOWN8
00:FFFF IO_IE

View File

@ -292,6 +292,8 @@ usage:
GB_load_battery(&gb, battery_save_path);
/* Configure symbols */
GB_debugger_load_symbol_file(&gb, executable_relative_path("registers.sym"));
char symbols_path[path_length + 5];
replace_extension(filename, path_length, symbols_path, ".sym");
GB_debugger_load_symbol_file(&gb, symbols_path);