bebbo / libnix

libnix (v4): a C link library for AmigaOS/m68k
15 stars 9 forks source link

Output to stderr broken #10

Closed mheyer32 closed 5 years ago

mheyer32 commented 5 years ago

DoomAttack makes some output via fprintf(stderr, "xxx") but recently started to throw enforcer hits during the first fprintf() it runs into.

To reproduce, check out https://github.com/mheyer32/DoomAttack/commits/master add fprintf(stderr, "Test"); into the main function in i_main.c and build

Start winuaeenforcer, then start DoomAttack. It should throw enforcer hits almost immediately.

I believe this is libnix related as it doesn't occur with clib2. Weirdly enough, trying to create a minimal repro test application didn't show the issue. So it may have been something to do with the intricacies of linking a larger application.

bebbo commented 5 years ago
00f838ae :   2c69 0050            MOVEA.L (A1, $0050) == $407244ae [40724422],A6
00f838b2 :   202e 0004            MOVE.L (A6, $0004) == $4000084c [40109bf0],D0
00f838b6 :   2a8e                 MOVE.L A6,(A5) [00000000]
00f838b8 :   2d4d 0004            MOVE.L A5,(A6, $0004) == $4000084c [40109bf0]
00f838bc :   2c40                 MOVEA.L D0,A6
00f838be :   2c8d                 MOVE.L A5,(A6) [401121d4]
00f838c0 :   2a69 0010            MOVEA.L (A1, $0010) == $4072446e [00000000],A5
00f838c4 :   234d 000c            MOVE.L A5,(A1, $000c) == $4072446a [00000000]
00f838c8 : * 082d 0007 001e       BTST.B #$0007,(A5, $001e) == $0000001e [0a]
00f838ce :   6716                 BEQ.B #$16
00f838d0 :   4bed 0030            LEA.L (A5, $0030) == $00000030,A5
00f838d4 :   2c69 0050            MOVEA.L (A1, $0050) == $407244ae [40724422],A6
00f838d8 :   202e 0004            MOVE.L (A6, $0004) == $4000084c [40109bf0],D0
00f838dc :   2a8e                 MOVE.L A6,(A5) [00000000]
00f838de :   2d4d 0004            MOVE.L A5,(A6, $0004) == $4000084c [40109bf0]
00f838e2 :   2c40                 MOVEA.L D0,A6
00f838e4 :   2c8d                 MOVE.L A5,(A6) [401121d4]

the enforcer hits are triggered by the sound routines.

mheyer32 commented 5 years ago

The hits (and subsequent hang) I witnessed happens basically right at the first fprint(stderr,...) - i.e. the one I inserted into main().

There are other issues with DoomAttack, but this one is biting me right now.

Can you determine if the enforcer hit you saw comes from line 685 in i_sound.c, I_InitSound() ? fprintf(stderr, "I_InitSound: sound module ready\n"); If so, then we're both talking bout the same issue.

Enforcer Hit! Bad program
Illegal LONG WRITE to: 00000000                 PC: 00f824cc
Data: aaaaaac2 aaaaaaaa 00000057 aaaaaaaa 40515f30 00000004 40467754 00000004
Addr: 00000000 40515df0 404e51f4 00000000 00000057 40515e34 40000868 40515de8
Stck: 00f9f140 aaaaaac2 00000000 05004051 5e045f00 00000000 40515df0 404e51f4
Stck: 00000057 00000000 00000000 aaaaaaaa 40515f30 00000004 40467754 00000004
Stck: 40000a10 000000ff 00000001 40515e74 40000868 4001f66c 00fa3bc2 40515f30
Stck: 00000004 40515f30 00000004 00000000 00000000 404105ec 404676f8 40410ea4
Stck: 40515fa4 00fa3b72 40515f30 00000004 40467754 00000004 40515f30 ffffff81
00f824b2 :   522e 0126            ADD.B #$01,(A6,$0126) == $4000098e [00]
00f824b6 :   1340 0008            MOVE.B D0,(A1,$0008) == $40515df8 [05]
00f824ba :   5888                 ADDA.L #$04,A0
00f824bc :   2028 0004            MOVE.L (A0,$0004) == $00000004 [40000868],D0
00f824c0 :   2149 0004            MOVE.L A1,(A0,$0004) == $00000004 [40000868]
00f824c4 :   c188                 EXG.L D0,A0
00f824c6 :   48d1 0101            MVMLE.L #$0101,(A1)
00f824ca :   2089                 MOVE.L A1,(A0) [00000000]
00f824cc : * 2241                 MOVEA.L D1,A1
00f824ce :   2229 0010            MOVE.L (A1,$0010) == $40515e00 [00000000],D1
00f824d2 :   6716                 BEQ.B #$16
00f824d4 :   1029 000e            MOVE.B (A1,$000e) == $40515dfe [5f],D0
00f824d8 :   c07c 0003            AND.W #$0003,D0
00f824dc :   6728                 BEQ.B #$28
00f824de :   b03c 0001            CMP.B #$01,D0
00f824e2 :   6616                 BNE.B #$16
00f824e4 :   2241                 MOVEA.L D1,A1
Name: "DoomAttack"
bebbo commented 5 years ago

the cause is in here: setbuf(stdout, NULL);

bebbo commented 5 years ago

that change should be live soon.

The enforcer hits occur on scene changes, game starting, game stopping and so on. Maybe caused by sound stopping and starting? But that's another issue then.

mheyer32 commented 5 years ago

Thanks a bunch! I'll check it out tonight.

Maybe I can repro the other hits, too.

mheyer32 commented 5 years ago

Nope, I still see the issue here.

I am trying to produce a libnix with debug symbols - can you tell me what the canonical way is? I tried export CFLAGS_FOR_TARGET="-O2 -fno-omit-frame-pointer -g -ggdb -v" but it didn't work. I ended up manipulating CFLAGS inside projects/libnix/Makefile.gcc manually.

Once that was done, I can now single-step through libnix, but haven't found anything so far. The enforcer hits don't seem to come up when I use the debugger. And maybe it has something to do with a difference of starting DoomAttack from Workbench vs. from Shell.

There is a slight difference in how stderr is handled in libnix when the app gets started from WorkBench vs. from CLI:

in __initstdio:
                        if (_WBenchMsg || (fp->lx_fh = stderrdes = Open((CONST_STRPTR)"*", MODE_OLDFILE)) == 0)
                            fp->lx_fh = sfd[STDOUT_FILENO]->lx_fh;

I don't know yet, how much difference that makes. One thing that sprung into my eye is that __exitstdiodoes not free __stdfiledes - this is something you should look into.

I'll keep you posted once I know more.

bebbo commented 5 years ago

... ups... I pushed a the changes so CFLAGS_FOR_TARGET are applied again^^ this affects amiga-gcc and libnix.

Then I'd go for

export CFLAGS_FOR_TARGET="-O0 -g"
bebbo commented 5 years ago

One thing that sprung into my eye is that exitstdio does not free stdfiledes - this is something you should look into.

__exitmalloc does the job of freeing all allocated memory chunks.

mheyer32 commented 5 years ago

I updated libnix with your latest changes. I managed to see what instruction is causing the issue... it seems to be the very first call to dos.library's Write() function inside

ssize_t write(int d, const void *buf, size_t nbytes)

trying to print a single character 'T' out of my "Test" string.

Weirdly, all function parameters seem ok (DOSBase, the pointer to the string, nbytes =1 ) ... the only thing I could not verify is the file handle - which should the same as stdout.

mheyer32 commented 5 years ago

I found it. It is the filehandle thats broken!

This line is borked: fp->lx_fh = sfd[STDOUT_FILENO]->lx_fh; It should have been fp->lx_fh = __stdfiledes[STDOUT_FILENO]->lx_fh; because sfd gets advanced in the code above and does no longer point to the start of the array.

bebbo commented 5 years ago

well done - thank you!

mheyer32 commented 5 years ago

Now off to other with DoomAttack. Can you still see enforcer hits?

The main issues I'm dealing with right now a) the c2p_020_blitter C2P method is behaving erratic: sometimes everything works fine, sometimes you get flickering corruption, sometimes the screen just stays dark, sometimes switching from game to workbench a couple of times restores the image. When exiting the game, we get corrupted memory lists.

b) exiting from the game sometimes cause enforcer hits. I think this is because DeleteTask() either needs to be tucked into a Forbid()/Permit() pair or DeleteTask() needs to do so around the RemTask() call.

Closing!

bebbo commented 5 years ago

isn't ADoom working? Just copy the working code^^ (I have no idea about what is what)

And yes, I get many Enforcer hits in DoomAttack plus the enemies are invisible.

ADoom only yields the sound enforcer hits.

PS: I am pushing some more changes to libnix, to reduce the minimal size and hopefully do not kill stderr again^^

mheyer32 commented 5 years ago

Yes, ADoom is working ok. They basically use the same method to do the Blitter-C2P and signal the FlipTask to flip the screen when the blitting is done - its almost identical code. That's whats so weird about it. But I don't think its has anything to do with libnix now. The reason I'd like to get DoomAttack working, too, is because it implements more of the game in assembly and thus is slightly faster than ADoom. And as you saw, its another good test for gcc ;-)

And yes, I get many Enforcer hits in DoomAttack plus the enemies are invisible.

Oh wow! That is new. What config are you testing on? Do you have uncommon patches running? I am using BlizKick, SetPatch and MCP mostly.

ADoom only yields the sound enforcer hits.

That is news to me, too. I somehow need to reproduce your environment.

bebbo commented 5 years ago

I'm testing with WinUAE and some bold settings, using the HD-image of my real A3000.

PROCESSOR: CPU 68040/68040fpu/68040mmu CUSTOM CHIPS: AA PAL Alice (id=$0023), AA Lisa (id=$00F8) VERS: Kickstart version 40.63, Exec version 40.10, Disk version 45.1 RAM: Node type $A, Attributes $405 (FAST), at $40000000-$5FFFFFFF (512.0 meg) Node type $A, Attributes $703 (CHIP), at $3000-$3FFFFF (~4.0 meg) BOARDS: Board + ROM (HD?) (unidentified): Prod=2011/82($7DB/$52) (@$E90000 64K) RAM (unidentified): Prod=2011/83($7DB/$53) (@$40000000, size 512meg, subsize same Mem) Board (unidentified): Prod=2011/96($7DB/$60) (@$60000000, size 8meg, subsize 8meg) Board (unidentified): Prod=2011/4($7DB/$4) (@$F00000 64K)

mheyer32 commented 5 years ago

What is the base config? A1200/A4000? 4MB chipmem is bold :-D

mheyer32 commented 5 years ago

Oh, and are you running RTG? If so, what Gfx card?

bebbo commented 5 years ago

What is the base config? A1200/A4000?

Chipset Extra: A1200

Oh, and are you running RTG? If so, what Gfx card?

UAE Zorro III

config_description=myx
config_hardware=true
config_host=true
config_version=4.0.0
config_hardware_path=
config_host_path=
config_all_path=
win32.rom_path=./
win32.floppy_path=./
win32.hardfile_path=./
; host-specific
win32.middle_mouse=true
win32.map_drives=true
win32.soundcard=4
win32.soundcardname=Primärer Soundtreiber
win32.soundcardname.utf8=Primärer Soundtreiber
win32.cpu_idle=105
; common
use_gui=no
use_debugger=false
kickstart_rom_file=C:\Users\Public\Documents\Amiga Files\WinUAE\Roms\Kick-3.1-40.63.A500-600-2000.rom
kickstart_rom_file_id=FC24AE0D,KS ROM v3.1 (A500,A600,A2000)
kickstart_ext_rom_file=
ide_mb_rom_file=:ENABLED
pcmcia_mb_rom_file=:ENABLED
flash_file=
cart_file=
rtc_file=
kickshifter=true
floppy_volume=33
floppy0=
floppy1=
floppy2=
floppy2type=0
floppy3=
floppy3type=0
nr_floppies=4
floppy_speed=800
cd_speed=100
parallel_on_demand=false
serial_on_demand=false
serial_hardware_ctsrts=true
serial_direct=false
scsi=false
uaeserial=false
sana2=false
sound_output=exact
sound_channels=stereo
sound_stereo_separation=7
sound_stereo_mixing_delay=0
sound_max_buff=16384
sound_frequency=44100
sound_interpol=anti
sound_filter=emulated
sound_filter_type=standard
sound_volume=0
sound_volume_paula=0
sound_volume_cd=0
sound_volume_ahi=0
sound_volume_midi=0
sound_volume_genlock=0
sound_auto=true
sound_cdaudio=false
sound_stereo_swap_paula=false
sound_stereo_swap_ahi=false
comp_trustbyte=direct
comp_trustword=direct
comp_trustlong=direct
comp_trustnaddr=direct
comp_nf=true
comp_constjump=true
comp_flushmode=soft
compfpu=true
cachesize=16384
joyport0=mouse
joyport0autofire=none
joyportfriendlyname0=Windows mouse
joyportname0=WINMOUSE1
joyport1=kbd1
joyport1autofire=none
bsdsocket_emu=true
synchronize_clock=false
maprom=0x0
parallel_postscript_emulation=false
parallel_postscript_detection=false
ghostscript_parameters=
parallel_autoflush=5
gfx_display=0
gfx_display_rtg=0
gfx_framerate=1
gfx_width=1024
gfx_height=768
gfx_top_windowed=798
gfx_left_windowed=174
gfx_width_windowed=1024
gfx_height_windowed=768
gfx_width_fullscreen=800
gfx_height_fullscreen=600
gfx_refreshrate=0
gfx_autoresolution=0
gfx_autoresolution_vga=true
gfx_backbuffers=2
gfx_backbuffers_rtg=1
gfx_vsync=false
gfx_vsyncmode=normal
gfx_vsync_picasso=false
gfx_vsyncmode_picasso=normal
gfx_lores=false
gfx_resolution=hires
gfx_lores_mode=normal
gfx_flickerfixer=false
gfx_linemode=double2
gfx_fullscreen_amiga=false
gfx_fullscreen_picasso=false
gfx_center_horizontal=none
gfx_center_vertical=none
gfx_colour_mode=32bit
gfx_blacker_than_black=false
gfx_api=direct3d
gfx_api_options=hardware
immediate_blits=false
ntsc=false
genlock=false
chipset=aga
chipset_refreshrate=59.357559
collision_level=playfields
chipset_compatible=A1200
rtc=MSM6242B
ksmirror_a8=true
pcmcia=true
ide=a600/a1200
fastmem_size=0
debugmem_start=0x0
debugmem_size=0
mem25bit_size=0
a3000mem_size=0
mbresmem_size=0
z3mem_size=512
z3mem_start=0x10000000
bogomem_size=0
gfxcard_hardware_vblank=false
gfxcard_hardware_sprite=true
gfxcard_multithread=false
gfxcard_size=8
gfxcard_type=ZorroIII
chipmem_size=8
cpu_speed=max
cpu_throttle=0.0
cpu_type=68040
cpu_model=68040
fpu_model=68040
cpu_compatible=false
cpu_24bit_addressing=false
cpu_data_cache=false
cpu_cycle_exact=false
cpu_memory_cycle_exact=false
blitter_cycle_exact=false
cycle_exact=false
fpu_strict=true
rtg_nocustom=true
rtg_modes=0x212
log_illegal_mem=false
kbd_lang=us
filesystem2=rw,dh0:Work:d:\Amiga\MyWB31,0
uaehf0=dir,rw,dh0:Work:d:\Amiga\MyWB31,0
hardfile2=rw,DH1:D:\Amiga\harddisk0.hdf,28,6,2,512,-128,,ide0
uaehf1=hdf,rw,DH1:"D:\\Amiga\\harddisk0.hdf",28,6,2,512,-128,,ide0
input.config=1
input.joymouse_speed_analog=100
input.joymouse_speed_digital=10
input.joymouse_deadzone=33
input.joystick_deadzone=33
input.analog_joystick_multiplier=15
input.analog_joystick_offset=-1
input.mouse_speed=100
input.autofire_speed=600
input.autoswitch=1
input.1.joystick.0.empty=true
input.1.joystick.1.empty=true
input.1.joystick.2.empty=true
input.1.joystick.3.empty=true
input.1.joystick.4.empty=true
input.1.joystick.5.empty=true
input.1.joystick.6.empty=true
input.1.joystick.7.empty=true
input.1.joystick.8.empty=true
input.1.joystick.9.empty=true
input.1.joystick.10.empty=true
input.1.joystick.11.empty=true
input.1.joystick.12.empty=true
input.1.joystick.13.empty=true
input.1.joystick.14.empty=true
input.1.joystick.15.empty=true
input.1.joystick.16.empty=true
input.1.joystick.17.empty=true
input.1.joystick.18.empty=true
input.1.joystick.19.empty=true
input.1.mouse.0.friendlyname=Windows mouse
input.1.mouse.0.name=WINMOUSE1
input.1.mouse.0.empty=false
input.1.mouse.0.disabled=false
input.1.mouse.0.button.3=KEY_ALT_LEFT.0,KEY_CURSOR_LEFT.0.0
input.1.mouse.0.button.4=KEY_ALT_LEFT.0,KEY_CURSOR_RIGHT.0.0
input.1.mouse.1.friendlyname=Synaptics Pointing Device
input.1.mouse.1.name=\\?\ACPI#LEN0015#4&b4cbbe3&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
input.1.mouse.1.empty=true
input.1.mouse.2.friendlyname=Logitech HID-compliant G9x Laser Mouse
input.1.mouse.2.name=\\?\HID#VID_046D&PID_C066&MI_00#9&1d86a345&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
input.1.mouse.2.empty=true
input.1.mouse.3.empty=true
input.1.mouse.4.empty=true
input.1.mouse.5.empty=true
input.1.mouse.6.empty=true
input.1.mouse.7.empty=true
input.1.mouse.8.empty=true
input.1.mouse.9.empty=true
input.1.mouse.10.empty=true
input.1.mouse.11.empty=true
input.1.mouse.12.empty=true
input.1.mouse.13.empty=true
input.1.mouse.14.empty=true
input.1.mouse.15.empty=true
input.1.mouse.16.empty=true
input.1.mouse.17.empty=true
input.1.mouse.18.empty=true
input.1.mouse.19.empty=true
input.1.keyboard.0.friendlyname=WinUAE keyboard
input.1.keyboard.0.name=NULLKEYBOARD
input.1.keyboard.0.empty=false
input.1.keyboard.0.disabled=false
input.1.keyboard.0.button.183.SYSRQ=KEY_AMIGA_RIGHT.0,SPC_SCREENSHOT.0.I
input.1.keyboard.1.friendlyname=G9x Laser Mouse
input.1.keyboard.1.name=\\?\HID#VID_046D&PID_C066&MI_01&Col01#9&354a2f8a&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.1.keyboard.1.empty=true
input.1.keyboard.2.friendlyname=PS/2-Standardtastatur
input.1.keyboard.2.name=\\?\ACPI#LEN0071#4&b4cbbe3&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.1.keyboard.2.empty=true
input.1.keyboard.3.friendlyname=Pluralinput Keyboard 1.0
input.1.keyboard.3.name=\\?\HID#VID_04D9&PID_1203&MI_00#9&39f67662&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.1.keyboard.3.empty=true
input.1.keyboard.4.empty=true
input.1.keyboard.5.empty=true
input.1.keyboard.6.empty=true
input.1.keyboard.7.empty=true
input.1.keyboard.8.empty=true
input.1.keyboard.9.empty=true
input.1.keyboard.10.empty=true
input.1.keyboard.11.empty=true
input.1.keyboard.12.empty=true
input.1.keyboard.13.empty=true
input.1.keyboard.14.empty=true
input.1.keyboard.15.empty=true
input.1.keyboard.16.empty=true
input.1.keyboard.17.empty=true
input.1.keyboard.18.empty=true
input.1.keyboard.19.empty=true
input.1.internal.0.friendlyname=Internal events
input.1.internal.0.name=INTERNALEVENTS1
input.1.internal.0.empty=true
input.2.joystick.0.empty=true
input.2.joystick.1.empty=true
input.2.joystick.2.empty=true
input.2.joystick.3.empty=true
input.2.joystick.4.empty=true
input.2.joystick.5.empty=true
input.2.joystick.6.empty=true
input.2.joystick.7.empty=true
input.2.joystick.8.empty=true
input.2.joystick.9.empty=true
input.2.joystick.10.empty=true
input.2.joystick.11.empty=true
input.2.joystick.12.empty=true
input.2.joystick.13.empty=true
input.2.joystick.14.empty=true
input.2.joystick.15.empty=true
input.2.joystick.16.empty=true
input.2.joystick.17.empty=true
input.2.joystick.18.empty=true
input.2.joystick.19.empty=true
input.2.mouse.0.friendlyname=Windows mouse
input.2.mouse.0.name=WINMOUSE1
input.2.mouse.0.empty=true
input.2.mouse.1.friendlyname=Synaptics Pointing Device
input.2.mouse.1.name=\\?\ACPI#LEN0015#4&b4cbbe3&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
input.2.mouse.1.empty=true
input.2.mouse.2.friendlyname=Logitech HID-compliant G9x Laser Mouse
input.2.mouse.2.name=\\?\HID#VID_046D&PID_C066&MI_00#9&1d86a345&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
input.2.mouse.2.empty=true
input.2.mouse.3.empty=true
input.2.mouse.4.empty=true
input.2.mouse.5.empty=true
input.2.mouse.6.empty=true
input.2.mouse.7.empty=true
input.2.mouse.8.empty=true
input.2.mouse.9.empty=true
input.2.mouse.10.empty=true
input.2.mouse.11.empty=true
input.2.mouse.12.empty=true
input.2.mouse.13.empty=true
input.2.mouse.14.empty=true
input.2.mouse.15.empty=true
input.2.mouse.16.empty=true
input.2.mouse.17.empty=true
input.2.mouse.18.empty=true
input.2.mouse.19.empty=true
input.2.keyboard.0.friendlyname=WinUAE keyboard
input.2.keyboard.0.name=NULLKEYBOARD
input.2.keyboard.0.empty=false
input.2.keyboard.0.disabled=false
input.2.keyboard.1.friendlyname=G9x Laser Mouse
input.2.keyboard.1.name=\\?\HID#VID_046D&PID_C066&MI_01&Col01#9&354a2f8a&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.2.keyboard.1.empty=true
input.2.keyboard.2.friendlyname=PS/2-Standardtastatur
input.2.keyboard.2.name=\\?\ACPI#LEN0071#4&b4cbbe3&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.2.keyboard.2.empty=true
input.2.keyboard.3.friendlyname=Pluralinput Keyboard 1.0
input.2.keyboard.3.name=\\?\HID#VID_04D9&PID_1203&MI_00#9&39f67662&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.2.keyboard.3.empty=true
input.2.keyboard.4.empty=true
input.2.keyboard.5.empty=true
input.2.keyboard.6.empty=true
input.2.keyboard.7.empty=true
input.2.keyboard.8.empty=true
input.2.keyboard.9.empty=true
input.2.keyboard.10.empty=true
input.2.keyboard.11.empty=true
input.2.keyboard.12.empty=true
input.2.keyboard.13.empty=true
input.2.keyboard.14.empty=true
input.2.keyboard.15.empty=true
input.2.keyboard.16.empty=true
input.2.keyboard.17.empty=true
input.2.keyboard.18.empty=true
input.2.keyboard.19.empty=true
input.2.internal.0.friendlyname=Internal events
input.2.internal.0.name=INTERNALEVENTS1
input.2.internal.0.empty=true
input.3.joystick.0.empty=true
input.3.joystick.1.empty=true
input.3.joystick.2.empty=true
input.3.joystick.3.empty=true
input.3.joystick.4.empty=true
input.3.joystick.5.empty=true
input.3.joystick.6.empty=true
input.3.joystick.7.empty=true
input.3.joystick.8.empty=true
input.3.joystick.9.empty=true
input.3.joystick.10.empty=true
input.3.joystick.11.empty=true
input.3.joystick.12.empty=true
input.3.joystick.13.empty=true
input.3.joystick.14.empty=true
input.3.joystick.15.empty=true
input.3.joystick.16.empty=true
input.3.joystick.17.empty=true
input.3.joystick.18.empty=true
input.3.joystick.19.empty=true
input.3.mouse.0.friendlyname=Windows mouse
input.3.mouse.0.name=WINMOUSE1
input.3.mouse.0.empty=true
input.3.mouse.1.friendlyname=Synaptics Pointing Device
input.3.mouse.1.name=\\?\ACPI#LEN0015#4&b4cbbe3&0#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
input.3.mouse.1.empty=true
input.3.mouse.2.friendlyname=Logitech HID-compliant G9x Laser Mouse
input.3.mouse.2.name=\\?\HID#VID_046D&PID_C066&MI_00#9&1d86a345&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
input.3.mouse.2.empty=true
input.3.mouse.3.empty=true
input.3.mouse.4.empty=true
input.3.mouse.5.empty=true
input.3.mouse.6.empty=true
input.3.mouse.7.empty=true
input.3.mouse.8.empty=true
input.3.mouse.9.empty=true
input.3.mouse.10.empty=true
input.3.mouse.11.empty=true
input.3.mouse.12.empty=true
input.3.mouse.13.empty=true
input.3.mouse.14.empty=true
input.3.mouse.15.empty=true
input.3.mouse.16.empty=true
input.3.mouse.17.empty=true
input.3.mouse.18.empty=true
input.3.mouse.19.empty=true
input.3.keyboard.0.friendlyname=WinUAE keyboard
input.3.keyboard.0.name=NULLKEYBOARD
input.3.keyboard.0.empty=false
input.3.keyboard.0.disabled=false
input.3.keyboard.1.friendlyname=G9x Laser Mouse
input.3.keyboard.1.name=\\?\HID#VID_046D&PID_C066&MI_01&Col01#9&354a2f8a&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.3.keyboard.1.empty=true
input.3.keyboard.2.friendlyname=PS/2-Standardtastatur
input.3.keyboard.2.name=\\?\ACPI#LEN0071#4&b4cbbe3&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.3.keyboard.2.empty=true
input.3.keyboard.3.friendlyname=Pluralinput Keyboard 1.0
input.3.keyboard.3.name=\\?\HID#VID_04D9&PID_1203&MI_00#9&39f67662&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd}
input.3.keyboard.3.empty=true
input.3.keyboard.4.empty=true
input.3.keyboard.5.empty=true
input.3.keyboard.6.empty=true
input.3.keyboard.7.empty=true
input.3.keyboard.8.empty=true
input.3.keyboard.9.empty=true
input.3.keyboard.10.empty=true
input.3.keyboard.11.empty=true
input.3.keyboard.12.empty=true
input.3.keyboard.13.empty=true
input.3.keyboard.14.empty=true
input.3.keyboard.15.empty=true
input.3.keyboard.16.empty=true
input.3.keyboard.17.empty=true
input.3.keyboard.18.empty=true
input.3.keyboard.19.empty=true
input.3.internal.0.friendlyname=Internal events
input.3.internal.0.name=INTERNALEVENTS1
input.3.internal.0.empty=true
input.4.keyboard.0.friendlyname=WinUAE keyboard
input.4.keyboard.0.name=NULLKEYBOARD
input.4.keyboard.0.custom=true
mheyer32 commented 5 years ago

More questions: Do you run Workbench in UAEGFX mode?

When you saw DoomAttack or ADoom throwing enforcer hits and behaving badly, did you select a UAEGFX mode? If so, can you try running a native mode with C2P?

Why do you use a A500 Kickstart as opposed to a A1200?

How did you get UAEGFX working? I set it up in WinUAE, I installed Picasso96 but as soon as I select one of the UAEGFX modes in either game or workbench, the emulated machine crashes hard (it says halt HALT on the status).

bebbo commented 5 years ago

More questions: Do you run Workbench in UAEGFX mode?

Yes, I'm using: UAE: 1024x768 32 Bit.

When you saw DoomAttack or ADoom throwing enforcer hits and behaving badly, did you select a UAEGFX mode? If so, can you try running a native mode with C2P?

Usually I use UAE 320x200 8 bit. (IMHO the screenmode should define the screensize unless a smaller screen size was given, but it always uses only 320x200)

ADoom is also running in native modes (PAL:Low Res) and yields few more sound enforcer hits DoomAttack does not start: "The selected c2p file could not be opened" ... installation issue.

Why do you use a A500 Kickstart as opposed to a A1200?

I copied this config around and use a similar one for kick1.3 68000 tests. Well, it's working here, so why should I change it?

How did you get UAEGFX working? I set it up in WinUAE, I installed Picasso96 but as soon as I select one of the UAEGFX modes in either game or workbench, the emulated machine crashes hard (it says halt HALT on the status).

I simply installed it? Is the RTG board configured in WinUAE?

mheyer32 commented 5 years ago

It was MCP... some of its patches interferes with either UAEGFX or Picasso.

Now I can run both DoomAttack and ADoom in UAEGFX modes. I can see that its restricted to 320x200 (I think I did that on purpose :-D )

But no sound related enforcer hits so far. Are you running any patches or maybe a soundcard?

bebbo commented 5 years ago

maybe it's my kickstart version...

and here is my change to use the selected resolution:

diff --git a/adoom_src/amiga_video.c b/adoom_src/amiga_video.c
index 174242b..2a75a22 100644
--- a/adoom_src/amiga_video.c
+++ b/adoom_src/amiga_video.c
@@ -699,6 +699,9 @@ void I_InitGraphics(void)
             }

             video_oscan_height = dimsinfo.MaxOScan.MaxY - dimsinfo.MaxOScan.MinY + 1;
+
+           SCREENWIDTH = dimsinfo.Nominal.MaxX - dimsinfo.Nominal.MinX + 1;
+           SCREENHEIGHT = dimsinfo.Nominal.MaxY - dimsinfo.Nominal.MinY + 1;

             video_is_cyber_mode = 0;
             if (CyberGfxBase != NULL)
diff --git a/adoom_src/d_main.c b/adoom_src/d_main.c
index 32c76f9..9149f7a 100644
--- a/adoom_src/d_main.c
+++ b/adoom_src/d_main.c
@@ -991,9 +991,6 @@ void D_DoomMain(void)
         autostart = true;
     }

-    // init subsystems
-    printf("V_Init: allocate screens.\n");
-    V_Init();

     printf("M_LoadDefaults: Load system defaults.\n");
     M_LoadDefaults();  // load before initing other systems
@@ -1074,6 +1071,10 @@ void D_DoomMain(void)
     printf("I_Init: Setting up machine state.\n");
     I_Init();

+        // init subsystems
+    printf("V_Init: allocate screens.\n");
+    V_Init();
+
     printf("D_CheckNetGame: Checking network game status.\n");
     D_CheckNetGame();

diff --git a/adoom_src/v_video.c b/adoom_src/v_video.c
index 24601df..a79a402 100644
--- a/adoom_src/v_video.c
+++ b/adoom_src/v_video.c
@@ -483,14 +483,14 @@ void V_Init(void)
         p = M_CheckParm("-width");
         if (p && p < myargc - 1)
             SCREENWIDTH = atoi(myargv[p + 1]);
-        else
-            SCREENWIDTH = 320;
+//        else
+//            SCREENWIDTH = 320;

         p = M_CheckParm("-height");
         if (p && p < myargc - 1)
             SCREENHEIGHT = atoi(myargv[p + 1]);
-        else
-            SCREENHEIGHT = 200;
+//        else
+//            SCREENHEIGHT = 200;

 #ifdef GRAFFITI
     }
mheyer32 commented 5 years ago

I put your patch into ADoom. Weirdly, a 320x128PAL mode is offered, which actually doesn't look bad at all... the weapon sprite is misaligned, but that might actually be a good mode for low end amigas...and still get fullscreen.

You can give DoomAttack another go. I finally found the memory corruption bug(finally!!!) and also fixed the invisible enemies. I had the fix for the invisible things already in one of my 'floating' patches, thats why I couldn't repro.

I wonder if the memory corruption bug (aligning the bitplanes to 4k caused the C2P code to write beyond the screen bitmaps) is also giving people on the TF330 with the Akiko trouble.

Please let me know, if you're still seeing enforcer hits with the sound.... better yet, file a bug on my repo :-D

bebbo commented 5 years ago

You can give DoomAttack another go. I finally found the memory corruption bug(finally!!!) and also fixed the invisible enemies. I had the fix for the invisible things already in one of my 'floating' patches, thats why I couldn't repro.

The enemies are visible now and I'm getting no enforcer hits atm. Good job!