News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - llm

#61
its a Medium-Model (https://devblogs.microsoft.com/oldnewthing/20200728-00/?p=104012) DOS Exe
that means multiple code-segments (far calls to code if in another segment), a single data-segment (so data is always NEAR adressed, not data-segment changes needed)

the original Stunts is based on "Microsoft C 5.1" (from ~1988, years before the Visual C stuff)
so there is some stuff in the code that comes from the standard-library and the compiler - for example the
code around the main function etc.

the assembler source is currently assemble-able with TASM only (would be nice to port to WASM/MASM/UASM to be able to build under any system - just takes time its not super hard - minor differences)

the splitting to the segment files was primary done for better overview/seperation and for beeing able to easier be able to check if a assembled object
is binary exact to the original segment block (due to tiny difference in the assemblers (optimization features) or redundant commands some codes can be expressed with different opcodes of different size - what will corrupt non-symbolic-offsets) it was needed to check first if the resulting exe is absolutely exact to the original

the segment inc files are forward declaration so it easy to give every segments access to the "globals" around

the other inc and asm files are more for making it assemble-able or collect type definitions (that do to their nature do not bases on code) outside of the code

most (98%) of the code is generated with a script from IDA Pro - so changes to the IDA Database (IDB) will result in differently generated code
also the overload with C functions is done in this script

there are some build types - the pure original assembler (directly based on the IDA information), a variant were the standard-library is used and combined with already ported C functions (that are much easier to read then the assembler functions)

so there was never handwritten assembler code - everything (except your changes) is fully automaticly generated by IDA

IDA-Screenshot: https://pasteboard.co/AnVaANHb0Qq3.png
#62
Quote from: Daniel3D on July 17, 2022, 08:14:39 AM
Quote from: llm on July 17, 2022, 07:32:37 AM
Quote from: Daniel3D on July 16, 2022, 09:04:01 PM
...Even if we totally understand the code and port it to C, we would still have to rewrite all graphics related code to get SVGA.

but it would only take some short days to get higher resolution - if it was C Code :)
Wouldn't that not still be a fixed resolution?
I mean. If I understand the code correctly all graphics related code is based on fixed coordinates.
You can change that everywhere in the code and have a higher resolution but to make a dynamic resolution resolution is I think a lot more work.

you're right - dynamic resolution would take some more time
#63
Quote from: Daniel3D on July 16, 2022, 09:04:01 PM
...Even if we totally understand the code and port it to C, we would still have to rewrite all graphics related code to get SVGA.

but it would only take some short days to get higher resolution - if it was C Code :)
#64
Quote from: Daniel3D on July 16, 2022, 09:11:13 AM
Well,I can kinda follow what you are doing. But this is to advanced for me.

the implementation itself is easy if one knows the dosbox/16bit code internas a little
but the stunts related code (offsets etc.) needs stunts knowledge from reversing

Quote from: Daniel3D on July 16, 2022, 09:11:13 AM
I did find a code part where the track is loaded. It seems to be a sequence of multiple passes per tile. Maybe there are clues about collision data hidden

it sometimes helps to see the data live going through the functions for analysis - my tracer is something like that
debugging step by step isn't always the best way understanding it clearly
#65
btw: this type of tracing is possible for every stunts function or code part - if its relevant for understanding what stunts is doing etc.
#66
i've did a quick trace with the MT15.DRV

all tsub[NR] names are the functions from the public driver interface (the 23 functions in the jump table)
in my C-Port all the public functions are currently called c_tsub[NR] - just named by the order they appear in the jump-table
(buts is mostly know what these functions do - very simple C-Code in my port)


tsub0 called 1 -> is driver init
tsub1 called 1 -> only calls tsub2 -> driver shutdown
tsub2 called 1 -> reset everything, silence
tsub3 called 76
tsub4 called 101
tsub5 called 74 -> empty implementation (called by Stunts but not needed by the MT15.DRV)
tsub6 called 6
tsub7 called 4
tsub8 called 2
tsub10 called 16
tsub11 called 6
tsub13 called 947
tsub16 called 581 -> empty implementation (called by Stunts but not needed by the MT15.DRV)
tsub21 called 1
tsub22 called 1


find for example "tsub0" in my MT15.DRV project

Original Assembler
https://github.com/LowLevelMahn/UnifiedMT15/blob/2947002fe4a839e7e4a3d66a27e5f3d6ff38587c/MT15.asm#L1198
C-Port:
https://github.com/LowLevelMahn/UnifiedMT15/blob/2947002fe4a839e7e4a3d66a27e5f3d6ff38587c/drv.c#L648

more traces with better parameter names


game.exe startet
driver = mt15.drv
driver init done
MT32: LCD-Message:   (C)1990,1991 DSI
tsub10: channel: 0
tsub10: channel: 1
tsub10: channel: 2
tsub10: channel: 3
tsub10: channel: 4
tsub10: channel: 5
tsub10: channel: 6
tsub10: channel: 7
tsub10: channel: 8
tsub10: channel: 9
tsub10: channel: 10
tsub10: channel: 11
tsub10: channel: 12
tsub10: channel: 13
tsub10: channel: 14
tsub10: channel: 15
tsub8: unknown0: 21410
tsub22: should be MT32.PLB content with MT15.DRV: {05 02 00 18 32 18 00 00 00 45 6E 67 69 6E 65 20 31 20 20 07 05 0F 00 17 15 0B 01 01 00 35 07 00 00 00 37 28 32 23 0A 32 46 46 14 0D 10 10 23 14 09 69 07 37 00 00 00 00 2A 2E 64 32 64 64 64 64 64 32 5B 0C 1B 0C 00 00 05 00 00 00 19 64 64 64 64 17 4C 0B 01 01 00 35 07 00 00 00 37 28 32 23 0A 32 46 46 14 0D 10 10 23 14 09 69 07 37 00 00 00 00 2A 2E 64 32 64 64 64 64 64 32 5B 0C 1B 0C 00 00 05 00 00 00 19 64 64 64 64 18 32 0B 01 01 35 25 07 00 00 00 37 2D 2D 23 0A 32 46 46 14 0C 00 10 39 14 09 69 07 37 00 00 00 00 2A 2C 64 32 64 64 64 64 64 32 5B 0C 1B 0C 00 00 05 00 00 00 1D 64 64 63 64 00 00 0B 01 01 2B 35 07 00 00 00 37 28 32 23 0A 32 46 46 14 0D 10 10 23 14 09 69 07 37 00 00 00 00 2A 2E 64 32 64 64 64 64 64 32 5B 0C 1B 0C 00 00 05 00 00 00 19 64 64 64 64 02 01 18 32 0C 00 01 00 53 71 75 65 65 6C 20 20 20 20 00 08 0F 00 24 19 0B 01 00 25 64 07 00 00 00 00 06 00 00 00 64 64 64 00 48 64 00 03 1E 09 69 07 64 00 00 00 00 00 00 00 00 64 64 64 64 32 64 5B 0C 1B 0C 00 00 05 00 00 00 00 64 63 00 63 24 56 0B 01 00 25 58 07 00 00 00 00 06 00 00 00 64 64 64 00 48 64 00 03 1E 09 69 07 64 00 00 00 00 00 00 00 00 64 64 64 64 32 64 5B 0C 1B 0C 00 00 05 00 00 00 00 64 63 00 63 13 0B 0B 01 01 35 25 07 00 00 00 00 00 00 00 00 4E 4E 4E 00 32 64 10 39 14 09 69 07 37 00 00 00 00 2A 2C 64 32 64 64 64 64 46 64 5B 0C 1B 0C 00 00 05 02 00 00 00 64 63 00 64 07 5E 0B 01 00 35 64 07 00 00 00 00 00 00 00 00 50 50 51 00 21 64 00 1C 1E 09 69 07 37 00 00 00 00 2A 2C 64 32 64 64 64 64 46 64 5B 0C 1B 0C 00 00 05 00 00 00 00 64 63 00 63 02 02 18 32 0C 00 01 00 44 61 6D 61 67 65 20 20 20 20 05 05 0F 00 15 00 0F 00 00 12 42 00 04 00 00 14 1E 00 00 00 14 28 00 00 05 00 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 0E 00 46 00 0A 00 61 00 00 09 00 0F 00 00 13 41 00 04 00 00 14 14 00 00 64 50 00 00 00 0A 1E 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 13 11 3B 37 00 00 63 2D 04 12 00 0F 00 00 18 41 04 08 00 00 4C 17 13 0A 34 00 00 00 11 05 00 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 00 00 41 1D 0E 00 5E 17 03 14 00 0F 00 00 53 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 00 32 33 50 0C 53 64 2D 00 02 03 18 32 0C 00 01 00 4D 65 74 61 6C 43 6C 61 6E 6B 08 09 03 00 05 00 0F 00 00 45 41 00 03 00 00 14 1E 00 00 31 14 28 00 00 05 00 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 00 3F 3D 00 0A 62 00 00 00 0D 00 0F 00 01 58 41 00 04 00 00 3D 00 00 00 31 2F 00 00 00 18 0D 05 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 00 39 0C 04 2A 64 00 00 00 24 00 0F 00 00 18 41 04 05 00 00 4C 17 13 0A 34 00 00 00 11 05 00 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 00 40 06 17 1D 64 00 00 00 36 00 0F 00 00 53 41 00 02 00 00 0A 0A 00 00 64 50 32 00 00 00 00 00 64 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 64 4C 00 00 00 00 00 00 00 39 00 26 2C 64 00 00 00 02 04 18 32 0C 00 01 00 45 6E 67 69 6E 65 20 31 20 20 02 02 0F 00 24 32 0B 01 00 53 64 0E 00 00 00 37 2D 2D 23 0A 32 46 46 14 13 64 10 22 00 09 69 07 37 00 00 00 00 2A 2C 64 32 64 64 64 64 0D 32 40 0C 00 0C 00 00 05 00 00 00 13 64 64 64 64 18 4C 0B 01 01 00 35 07 00 00 00 37 28 32 23 0A 32 46 46 14 0D 10 10 23 14 09 69 07 37 00 00 00 00 2A 2E 64 32 64 64 64 64 64 32 5B 0C 1B 0C 00 00 05 00 00 00 19 64 64 64 64 16 32 0B 01 01 58 25 07 00 00 00 37 2D 2D 23 0A 32 46 46 14 0C 00 10 39 14 09 69 07 37 00 00 00 00 2A 2C 64 32 64 64 64 64 0E 32 5B 0C 1B 0C 00 00 05 00 00 00 1D 64 64 63 64 0C 36 0B 01 00 00 32 07 02 00 00 37 28 32 23 32 32 37 40 14 0D 10 10 38 12 0B 69 07 37 00 00 00 00 2A 2E 64 32 64 64 64 64 23 32 5B 0C 1B 0C 00 00 05 00 00 00 19 64 64 64 64}
tsub21: size: 4, buffer: {10 00 16 64}
tsub8: unknown0: 1
tsub6: channel_: 9, unknown2_: 0, controller_value_: 0x7F
tsub11: channel_: 9, unknown1: 0, unknown2: 81fc, buffer_(seg:ofs): 4543:118
MT32: playSysexWithoutHeader: Message checksum is incorrect (provided: 532ff5b0, expected: 7d)!
tsub3: channel: 9, struct1_(seg:ofs): 81fc:a2b6, key_note_number_: 24, velocity_: 5d, struct2_(seg:ofs): 4543:118
tsub6: channel_: 9, unknown2_: 0, controller_value_: 0x7F
tsub11: channel_: 9, unknown1: 0, unknown2: 8248, buffer_(seg:ofs): 4543:118
MT32: playSysexWithoutHeader: Message checksum is incorrect (provided: 532ff5b0, expected: 7d)!
tsub3: channel: 9, struct1_(seg:ofs): 8248:a2e4, key_note_number_: 31, velocity_: 3e, struct2_(seg:ofs): 4543:118
tsub6: channel_: 2, unknown2_: 0, controller_value_: 0x7F
tsub11: channel_: 2, unknown1: 0, unknown2: 8294, buffer_(seg:ofs): 4543:5e
tsub3: channel: 2, struct1_(seg:ofs): 8294:a312, key_note_number_: 3d, velocity_: 38, struct2_(seg:ofs): 4543:5e
tsub6: channel_: 5, unknown2_: 0, controller_value_: 0x7F
tsub11: channel_: 5, unknown1: 0, unknown2: 82e0, buffer_(seg:ofs): 4543:1d2
tsub6: channel_: 3, unknown2_: 0, controller_value_: 0x7F
tsub11: channel_: 3, unknown1: 0, unknown2: 832c, buffer_(seg:ofs): 4543:bb
tsub6: channel_: 6, unknown2_: 0, controller_value_: 0x7F
tsub11: channel_: 6, unknown1: 0, unknown2: 8378, buffer_(seg:ofs): 0:0
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub3: channel: 2, struct1_(seg:ofs): 8294:a2b6, key_note_number_: 36, velocity_: 2f, struct2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub3: channel: 9, struct1_(seg:ofs): 8248:a2e4, key_note_number_: 2c, velocity_: 12, struct2_(seg:ofs): 4543:118
tsub3: channel: 2, struct1_(seg:ofs): 8294:a312, key_note_number_: 31, velocity_: 3a, struct2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a2b6, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub3: channel: 9, struct1_(seg:ofs): 8248:a2b6, key_note_number_: 2a, velocity_: e, struct2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub3: channel: 9, struct1_(seg:ofs): 81fc:a2b6, key_note_number_: 24, velocity_: 5d, struct2_(seg:ofs): 4543:118
tsub3: channel: 9, struct1_(seg:ofs): 8248:a2e4, key_note_number_: 2a, velocity_: 18, struct2_(seg:ofs): 4543:118
tsub3: channel: 2, struct1_(seg:ofs): 8294:a312, key_note_number_: 31, velocity_: 35, struct2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 9, buffer1_(seg:ofs): 81fc:a2b6, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 9, buffer1_(seg:ofs): 8248:a2e4, buffer2_(seg:ofs): 4543:118
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e
tsub13: channel_: 2, buffer1_(seg:ofs): 8294:a312, buffer2_(seg:ofs): 4543:5e


attached is a full log of getting to the game menu and then exit to DOS
this trace contains all data sent to the driver so you would hear the stunts sounds/music if i could replay this trace with the same timing :)
#67
my dosbox extension for hooking the drv load+drv calling prototype works!
very few changes to dosbox staging needed to get it working :) +-45min

that means: i can trace all function calls from stunts into the sound driver (all drivers contain a equal jump-table with 23 functions - but only a few are needed for the driver to work - it seem like a generic interface with serveral features)

my github dosbox-staging fork branch: main_stunts_tests
commit: https://github.com/LowLevelMahn/dosbox-staging/commit/3604bcd5de0e6c4a188807f35b94088abbd51f08
main code: https://github.com/LowLevelMahn/dosbox-staging/blob/3604bcd5de0e6c4a188807f35b94088abbd51f08/src/_stunts/_stunts.cpp

dosbox detects the stunts game.exe start and hooks the drv function call tsub00 - the driver init - nothing more so far
https://imgur.com/a/MIF6i02

how to build:
1. VS2019 community edition (or VS2022) is needed to build under windows, or any not too old debian/ubuntu
2. clone my dosbox staging fork: https://github.com/LowLevelMahn/dosbox-staging
3. checkout main_stunts_tests branch
4. build sln file .\vs\dosbox.sln
(everything should build out of the box)

#68
Quote from: Daniel3D on July 14, 2022, 08:35:20 PM
Could you make it play the music as well?
Somebody (Darien?) Made a convert to midi at some point.

the first step is to analyse the Stunts <-> DRV communication - after that im able to write a player - but it will take some time
#69
i started to investigate my dosbox-extension-to-trace-DRV-data-communication-idea
seems to be easy, i've branched dosbox-staging and started to implement stunts-DRV-tracing :)

what can we do with that: each driver got 22 functions - few of them are used and i know at least based on my https://github.com/LowLevelMahn/UnifiedMT15 project what the parameter,content-size/types are - but not if these data just the VCE, MKS content

hope i've got a little time on the week-end to get at least some of my micro-projects ready

#70
Quote from: Daniel3D on July 13, 2022, 06:23:10 PM
Quote from: llm on July 13, 2022, 12:19:57 PM
so you got 77 different titles (with instrument data)
i thought each title contains multiple instruments - not a single instrument (as you stated)
I found a bit of light reading for you
Programmer's Guide to Yamaha YMF 262/OPL3 FM Music Synthesizer

OPL3 is a direct descendant of OPL2 (what a surprise), so most features of OPL2 are also present on OPL3.

thanks, i've got plenty of hardware programming documentation about the sound blaster - but this one is nice and small :)

another idea to easy the analyse of the VCE stuff would be logging the data that gets tunnelt from stunts to the loaded DRV-plugin
(at least extending the dosbox source a little)
maybe its just more or less the content of the VCE files then we can understand how this data is used exactly in den DRV
and write a small program that uses the DRV-Plugins to play the sounds without using stunts
i can do it, but my limited time makes every fun project a problem :)

#71
so you got 77 different titles (with instrument data)
i thought each title contains multiple instruments - not a single instrument (as you stated)
#72
Quote from: Daniel3D on July 13, 2022, 09:15:43 AM
I extracted them all from Mario's, boxing and stunts.

you talking about instruments like its is totally clear how the instrument-data is structured - i thought that isn't clear?

zapper wrote he knows that from the instrument-data block

QuoteColumns (decimal offset)
      300..339: not tested
      343: change pattern (decimal values: 15-31-47)
      344: change pattern (decimal values: 15-22-28-82)
      346: change pitch (decimal values: 3-5-7)
      352:   fadein
      356: fadeout
      358: change pattern (decimal values: 0-6)

how do you see 77 unique instruments in these bytes? i just don't understand were a instrument begins or ends, what is the byte-size of one instrument in the VCE files?
#73
Quote from: Daniel3D on July 12, 2022, 11:30:20 PM
4D boxing has many of the same instruments as stunts, but different coding.
So I made a test file with all instruments (77) to see if stunts can handle them and choose different ones than stunts to hear the sound.
Secondary objective is replacing music files for the Ferrari edition, to test the possibility it is convenient to have all instruments.

how do you know that there are 77 instruments available?
and how are these mappend in the instrument bytes?
zapper knows some of the bytes - do you know more?
#74
just ask if you need a special feature in vce_dump - the dirty cpp code is ease extendible to even dirtier style :)
#75
Quote from: Daniel3D on July 12, 2022, 05:18:39 PM
Now I wonder if they just missed the right instruments.

or contained gaps, dirt or a different ordering, now its easier to check
you can even compare two vce-export folder if the titles with same name are equal etc.