![]() |
![]() |
#61 | |
Registered User
Join Date: May 2006
Location: Paris/France
Age: 52
Posts: 530
|
Quote:
![]() ---edit Wait, you actually expect the output file to have the extension "p61" !. wow. Anyway, the music linked here hangs the prog : http://janeway.exotica.org.uk/release.php?id=58387 Possibly due to unused patterns ? Last edited by Asle; 19 July 2022 at 21:28. |
|
![]() |
![]() |
#62 | |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 277
|
Thanks for testing!
Sorry about that. Copy-pasted error message. Fixed now - the tool now assumes that output file format should be P61A, even if doesn't start with 'p61.' 'p61a.' or end with '.p61' or '.p61a' Quote:
Code:
C:\temp>P61AConv.exe MOD.beyond_music P61.beyond_music P61AConv V0.2 Copyright(C) 2022 Hop Loading mod from file: MOD.beyond_music Module loaded. Converting mod to P61A... Conversion succeeded Wrote P61A to file: P61.beyond_music Summary ======= File size: Uncompressed: 432158 0x6981E bytes Compressed: 372258 0x5AE22 bytes Bytes saved: 59900 0xE9FC Compression ratio: 1.16 Space saving: 13.9% Metadata: Uncompressed: 1084 0x43C bytes Compressed: 473 0x1D9 bytes Bytes saved: 611 0x263 Compression ratio: 2.29 Space saving: 56.4% Pattern data: Uncompressed: 38912 0x9800 bytes Compressed: 9689 0x25D9 bytes Bytes saved: 29223 0x7227 Compression ratio: 4.02 Space saving: 75.1% Sample data: Uncompressed: 392162 0x5FBE2 bytes Compressed: 362096 0x58670 bytes Bytes saved: 30066 0x7572 Compression ratio: 1.08 Space saving: 7.7% |
|
![]() |
![]() |
#63 |
Registered User
Join Date: Apr 2019
Location: UK
Posts: 277
|
In case this is of use to anyone, please find attached P61AConv.exe V0.3
This version generates identical binaries to the original P61Con on Amiga for the modules I've tested (mainly the ones from P6112.lha). It also generates the usecode. Generating identical binaries wasn't really necessary but I wanted to make sure I hadn't missed any important features, and it was a fun process... By debugging P61Con with mod.Dolphins-Dreamquest in WinUAE wrt to the original source code, at label 'eienaa', it can be seen that the length in bytes of the match 'bestreallength' is calculated incorrectly. This can be thought of as "scoring" the match. At the point it is calculated, the search end pos (in A0) has been advanced by the size of the last chunk *which did not match* (if another chunk actually followed). The code then proceeds to incorrectly and unconditionally subtract #3 saying "Taken up by dummy note,length and 8-bit offset", when the size of the last chunk could be anything between 1 and 6 bytes (1-3 control bytes + 0-3 compression bytes), or there might not actually have been a last chunk if it was end-of-stream. In the case in hand for P61.Dolphins-Dreamquest Pattern 3 channel 0 row 00 the search string is "F3 23 07 F3 23 07" but the compressed pattern data search window starts with "F3 23 07 F3 23 07 F3 23 07 B2 39 C2 01" which is 3 identical chunks "F3 23 07" of length 3 followed by a chunk "B2 39 C2 01" of length 4. Because of the mistake in the algorithm the tool favours the match starting at 0x3 over the one starting at 0x0 because on the second iteration the search pointer has advanced by an extra byte. There's also another minor off-by-two error when calculating the score. It always subtracts 1 if offset >= 256 but doesn't factor in the size of the compression chunk into the offset. This means that 16-bit jumps can be favoured over 8-bit jumps in some situations (I think). Neither of these bugs are dangerous at all, they can just result in slightly different (and occasionally, fractionally larger) binaries. I'll try to release the source for this when it's feature complete and converted to pure portable C. The current big missing feature is sample compression. Last edited by hop; 30 July 2022 at 00:44. Reason: clarification |
![]() |
![]() |
#64 |
Registered User
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
|
Does anyone know how to read diskfiles while player is running?
We are using macro to read diskfiles... it works if triggered prior to player, but once the player is active, reading a diskfile stalls the machine... I suspect IRQsetting or maybe player overwrites d0-d3 constantly? Code:
readfile macro move.l dosbase,a1 ;dosbase move.l \1,d1 ;file path move.l #modeold,d2 ;mode = old file jsr open(a1) ;call open-function move.l d0,filehandle ;save pointer to filehandle move.l d0,d1 move.l \2,d2 ;destination in memory move.l \3,d3 ;bytes to read jsr read(a1) ;call read-function move.l filehandle,d1 jsr close(a1) ;call close-function endm *** THE PLAYER USES THIS IRQ SETTING *** move #$7fff,intena(a6) ;disable IRQs move #$e000,intena(a6) ;enable IRQs, lev6, no copper IRQ Last edited by REAKTOR BEAR; 19 March 2023 at 11:07. |
![]() |
![]() |
#65 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,091
|
You have to use the P61 in one of the system friendly modes, so it uses system interrupt handlers instead of taking over the interrupts completely.
Basically, set p61system and p61exec to 1 when assembling the player. Note that this affects the performance. Custom solutions are possible, but you'd have to write some "tricky" code. |
![]() |
![]() |
#66 |
Registered User
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
|
Great thanks
![]() However, when we use P61con and "pack samples" it fails to load the module, is there a fix to this or is it better to compress P61 module inside the ASM compiled binary? Last edited by REAKTOR BEAR; 19 March 2023 at 17:44. |
![]() |
![]() |
#67 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,091
|
IIRC, pack samples reduces sample quality slightly so I've never used that.
It also requires a change in initialization, pointer to packed samples should be passed in a2. edit: It's sample buffer in a2, probably where to unpack the samples. |
![]() |
![]() |
#68 |
Registered User
Join Date: Mar 2021
Location: SWEDEN
Posts: 40
|
OK, Thanks... We will use Shrinkler, seems to be very good compression of ASM and binary.
|
![]() |
![]() |
#69 |
Registered User
Join Date: Jun 2016
Location: europe
Posts: 1,091
|
You could also try to delta the samples, it typically results in better compression.
Instead of d0, d1, d2, d3... you have d0, d1-d0, d2-d1, d3-d2... Then after decompression, you undelta them back to d0, d1, d2, d3... |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Super Optimized P6108.lha playroutine :) | Photon | Coders. General | 15 | 07 November 2013 18:15 |
Looking for ArtOfNoise Playroutine (68k assembler) | Herpes | Coders. Asm / Hardware | 5 | 05 September 2012 00:10 |
Tracker/Playroutine to play tubular.mod | Photon | Coders. General | 15 | 10 March 2006 21:09 |
Optimized Protracker playroutine? | Photon | Coders. General | 10 | 11 June 2005 00:54 |
|
|