zanto
Deep Blooper
Posts: 12
|
Post by zanto on Oct 22, 2023 5:44:10 GMT
Hi! I've been messing around with PCE assembly for the past few days and one thing I'm struggling with is that Mesen isn't showing any symbols on the debugger, so it's a nightmare to work with it.
This is the .bat file that assembles my test game.
Taskkill /IM Mesen.exe /FI "STATUS eq RUNNING" /F
set "tmp=%1.asm" set "tmp=%tmp:"=%" pceas2 -S -raw -m -l3 "%tmp%"
if not "%errorlevel%"=="0" goto Abandon
set "tmp=%1.pce" set "tmp=%tmp:"=%" start "C:\MyFiles\Development\PC Engine\Mesen\Mesen.exe" "%tmp%"
exit
:Abandon if "%3"=="nopause" exit pause
This is the .sym file created by pceas2
Label Addr Bank ----- ---- ---- psg_noise 0807 f0 DEVELO 0000 f0 timer_interrupt ffaa 00 psg_lfofreq 0808 f0 _dl 20fe f0 rom_start_add e000 f0 palette_reg_h 0403 f0 _ah 20f9 f0 irq1_vector_address fff8 f0 _bank_base 0000 f0 video_data_h 0003 f0 lsrw 0000 f0 psg_freqhi 0803 f0 nmi_vector_address fffc f0 _decw 0000 f0 bhi 0000 f0 rorw 0000 f0 _vsr 20f6 f0 sub 0000 f0 _adcw 0000 f0 _cx 20fc f0 palette_reg_l 0402 f0 _al 20f8 f0 timer_cnt 0c00 f0 _si 20ee f0 psg_ch 0800 f0 timerport 0c00 f0 _call_bank 0001 f0 decw 0000 f0 video_data_l 0002 f0 _tstw 0000 f0 VSYNC_routine e002 00 timer_ctrl 0c01 f0 tstw 0000 f0 adcw 0000 f0 bank_IO 00ff f0 video_reg 0000 f0 videoport 0000 f0 lblo 0000 f0 lbhs 0000 f0 CDROM 0000 f0 irq_port 1400 f0 lbpl 0000 f0 lbcc 0000 f0 map 0000 f0 _bh 20fb f0 stwz 0000 f0 MAGICKIT 0001 f0 _nb_bank 0002 f0 lbmi 0000 f0 lbeq 0000 f0 rolw 0000 f0 palette_reg 0402 f0 irq_disable 1402 f0 _vreg 20f7 f0 neg 0000 f0 irq2_vector_address fff6 f0 _sbcw 0000 f0 palette_data_h 0405 f0 irq_status 1403 f0 paletteport 0400 f0 _addw 0000 f0 _dx 20fe f0 bhs 0000 f0 _bl 20fa f0 vreg 0000 f0 timer_vector_address fffa f0 negw 0000 f0 blo 0000 f0 MAIN e000 00 .loop e000 00 bank_RAM 00f8 f0 lbne 0000 f0 _subw 0000 f0 joyport 1000 f0 sbcw 0000 f0 vdc_irq_screen 0005 f0 add 0000 f0 addw 0000 f0 subw 0000 f0 palette_data_l 0404 f0 stw 0000 f0 _ch 20fd f0 _ax 20f8 f0 vdc_interrupt ff87 00 ._exit ffa1 00 .vsync_test ff99 00 .hsync_test ff8f 00 psg_lfoctrl 0809 f0 vdc_table ff65 00 RESET ff00 00 reset_vector_address fffe f0 my_rti ffb0 00 psg_freqlow 0802 f0 psg_wave 0806 f0 video_data 0002 f0 psg_pan 0805 f0 _incw 0000 f0 _cl 20fc f0 reset_routine_address ff00 f0 _cmpw 0000 f0 _stw 0000 f0 aslw 0000 f0 psg_ctrl 0804 f0 video_reg_h 0001 f0 incw 0000 f0 stb 0000 f0 _irq_m 20f5 f0 cmpw 0000 f0 init_VDC ff3e 00 .init_end ff5f 00 .l1 ff47 00 lbcs 0000 f0 _bss_end 2201 f0 HSYNC_routine e003 00 _dh 20ff f0 _bx 20fa f0 psgport 0800 f0 _di 20f0 f0 palette_data 0404 f0 palette_ctrl 0400 f0 psg_mainvol 0801 f0 video_reg_l 0000 f0
I've also attached some images, one showing the debugger and the other the directory where all the files are.
I hope this is enough information. Thank you!
In the end, it seems like Mesen is far from being a good emulator for the PCE. :/
|
|
|
Post by turboxray on Oct 29, 2023 18:26:25 GMT
In the end, it seems like Mesen is far from being a good emulator for the PCE. :/
Why do you say that? It has thee most powerful debugger available for PCE. You just need to write a quick python or whatever script to convert the symbol file you have to something that's compatible with mesen 2. Edit: A quick search though mesen 2 source code and it showed this for the .sym import in the debugger: "//Assume WLA-DX symbol files". So you need to convert PCEAS sym format to WLA-DX format.
|
|
zanto
Deep Blooper
Posts: 12
|
Post by zanto on Oct 29, 2023 23:25:15 GMT
In the end, it seems like Mesen is far from being a good emulator for the PCE. :/
Why do you say that? It has thee most powerful debugger available for PCE. You just need to write a quick python or whatever script to convert the symbol file you have to something that's compatible with mesen 2. Edit: A quick search though mesen 2 source code and it showed this for the .sym import in the debugger: "//Assume WLA-DX symbol files". So you need to convert PCEAS sym format to WLA-DX format. That's what I heard from some people. And it made sense to me because I was having some graphical glitches that didn't happen on Mednafen or the MiSTer. Also, the debugger would act weird sometimes. Apparently PCE emulation is relatively new on Mesen? So yeah, I'm not sure. But I do wish I could use it, because, as you said, its debugger is amazing.
|
|
|
Post by turboxray on Oct 30, 2023 23:26:20 GMT
Why do you say that? It has thee most powerful debugger available for PCE. You just need to write a quick python or whatever script to convert the symbol file you have to something that's compatible with mesen 2. Edit: A quick search though mesen 2 source code and it showed this for the .sym import in the debugger: "//Assume WLA-DX symbol files". So you need to convert PCEAS sym format to WLA-DX format. That's what I heard from some people. And it made sense to me because I was having some graphical glitches that didn't happen on Mednafen or the MiSTer. Also, the debugger would act weird sometimes. Apparently PCE emulation is relatively new on Mesen? So yeah, I'm not sure. But I do wish I could use it, because, as you said, its debugger is amazing. If you can share what those glitches are, and a rom (doesn't have that exact rom, but something that shows the same graphic glitches) - can pass it along to the author. Most of the time it turns out to be a race condition for stuff like that. Also, I noticed that a lot of those symbols in the snippet you showed.. are bank F0. These are equates (defines), and not labels. PCEAS doesn't output enough information for those specific types of labels to be usable. Things like address labels are easy, but those kinds of symbols needs the address/location of where they are being used.. and the sym file doesn't output that info.
|
|
zanto
Deep Blooper
Posts: 12
|
Post by zanto on Oct 31, 2023 2:17:09 GMT
Yeah, I'll try to do that. Though it's always a little hard for me to know when it's a bug or when it's me doing something stupid. Most of the time, it's the latter
I have no idea why they are in F0. Is it PCEAS2's default? I have most of my defines and some memory aliases in a file called constants.inc, which is included at the beginning of the main asm file. And there are bunch of labels scattered throughout the code...
.include "include/constants.inc" .include "include/startup.asm" .include "INCLUDE/my_macros.inc" .include "INCLUDE/common_routines.asm" .include "include/joypad_routines.asm" .nomlist .list
.code .bank START_BANK .org $e000 main:
; do the things that must be done before the game starts ; ---- ; disable display jsr disp_off ; turns off display temporarily
Here's a piece of what's in that file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; VDC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
UI_PALETTE_INDEX = $00 WHITESPACE_VRAM = $1000 UI_VRAM = $1010 ; each tile in vram is takes $10 space UI_PALETTE_VRAM = UI_PALETTE_INDEX +(UI_VRAM/4096) FONT_VRAM = UI_VRAM BLANKTILE_INDEX = $0 FRAMETL_INDEX = $61 FRAMET_INDEX = $62 FRAMETR_INDEX = $63 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; SETTING UP RAM ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ZERO PAGE VARIABLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .zp vb_count: .ds 1 ; allocate 1 byte to count the number of vblanks. We use this to time some stuff status: .ds 1 slowmo: .ds 1 ;1=pause, 2=slow motion joytmp: .ds 1 ;Temporary storage for joy presses input_mode: .ds 1 ; input mode to process which routine will be called when a joypad btn is pressed
counter2b_1: .ds 2 counter2b_2: .ds 2 pointer2B_1: .ds 2 pointer2B_2: .ds 2 Is there a way to fix that?
|
|