Browse code

Changed samples from s8 to u8 format

Andrew Alderwick authored on 04/05/2021 06:26:36
Showing 23 changed files
... ...
@@ -370,7 +370,7 @@ RTN
370 370
 			#01 .Screen/color DEO
371 371
 		&no-dot
372 372
 		OVR TOS #0010 MUL2 [ DUP2r STH2r ] ADD2 LDA 
373
-		#02 DIV #40 ADD DUP #07 SFT #80 MUL SUB 
373
+		#02 DIV
374 374
 		TOS #0004 DIV2 .wav-view/y1 PEK2 ADD2 .Screen/y DEO2
375 375
 		.Screen/x DEI2 ++ .Screen/x DEO2
376 376
 		( draw ) #02 .Screen/color DEO
... ...
@@ -601,39 +601,39 @@ RTN
601 601
 ]
602 602
 
603 603
 @square-wave
604
-	a8 58
604
+	28 d8
605 605
 	&end
606 606
 
607 607
 @triangle-wave
608
-	0002 0406 080a 0c0e 1012 1416 181a 1c1e 2022 2426 282a 2c2e
609
-	3032 3436 383a 3c3e 4041 4345 4749 4b4d 4f51 5355 5759 5b5d
610
-	5f61 6365 6769 6b6d 6f71 7375 7779 7b7d 7f7d 7b79 7775 7371
611
-	6f6d 6b69 6765 6361 5f5d 5b59 5755 5351 4f4d 4b49 4745 4341
612
-	403e 3c3a 3836 3432 302e 2c2a 2826 2422 201e 1c1a 1816 1412
613
-	100e 0c0a 0806 0402 00fe fcfa f8f6 f4f2 f0ee ecea e8e6 e4e2
614
-	e0de dcda d8d6 d4d2 d0ce ccca c8c6 c4c2 c1bf bdbb b9b7 b5b3
615
-	b1af adab a9a7 a5a3 a19f 9d9b 9997 9593 918f 8d8b 8987 8583
616
-	8183 8587 898b 8d8f 9193 9597 999b 9d9f a1a3 a5a7 a9ab adaf
617
-	b1b3 b5b7 b9bb bdbf c1c2 c4c6 c8ca ccce d0d2 d4d6 d8da dcde
618
-	e0e2 e4e6 e8ea ecee f0f2 f4f6 f8fa fcfe
608
+	8082 8486 888a 8c8e 9092 9496 989a 9c9e a0a2 a4a6 a8aa acae
609
+	b0b2 b4b6 b8ba bcbe c0c1 c3c5 c7c9 cbcd cfd1 d3d5 d7d9 dbdd
610
+	dfe1 e3e5 e7e9 ebed eff1 f3f5 f7f9 fbfd fffd fbf9 f7f5 f3f1
611
+	efed ebe9 e7e5 e3e1 dfdd dbd9 d7d5 d3d1 cfcd cbc9 c7c5 c3c1
612
+	c0be bcba b8b6 b4b2 b0ae acaa a8a6 a4a2 a09e 9c9a 9896 9492
613
+	908e 8c8a 8886 8482 807e 7c7a 7876 7472 706e 6c6a 6866 6462
614
+	605e 5c5a 5856 5452 504e 4c4a 4846 4442 413f 3d3b 3937 3533
615
+	312f 2d2b 2927 2523 211f 1d1b 1917 1513 110f 0d0b 0907 0503
616
+	0103 0507 090b 0d0f 1113 1517 191b 1d1f 2123 2527 292b 2d2f
617
+	3133 3537 393b 3d3f 4142 4446 484a 4c4e 5052 5456 585a 5c5e
618
+	6062 6466 686a 6c6e 7072 7476 787a 7c7e
619 619
 	&end
620 620
 
621 621
 @sine-wave
622
-	0004 090e 1217 1c20 2529 2e32 363b 3f43 474b 4e52 5659 5c60
623
-	6365 686b 6d70 7274 7677 797a 7b7c 7d7e 7e7e 7e7e 7e7e 7d7c
624
-	7b7a 7978 7674 7270 6e6b 6966 6360 5d5a 5753 4f4c 4844 403c
625
-	3833 2f2a 2621 1d18 140f 0a05 01fc f7f2 eee9 e4e0 dbd7 d2ce
626
-	cac5 c1bd b9b5 b1ae aaa7 a3a0 9d9a 9795 9290 8e8c 8a88 8785
627
-	8483 8282 8181 8181 8181 8282 8384 8687 898a 8c8e 9193 9598
628
-	9b9e a1a4 a8ab afb2 b6ba bec2 c6cb cfd3 d8dc e1e6 eaef f4f8
629
-	fd02 070b 1015 191e 2327 2c30 3439 3d41 4549 4d50 5457 5b5e
630
-	6164 676a 6c6e 7173 7576 7879 7b7c 7d7d 7e7e 7e7e 7e7e 7d7d
631
-	7c7b 7a78 7775 7371 6f6d 6a68 6562 5f5c 5855 514e 4a46 423e
632
-	3a35 312d 2824 1f1b 1611 0d08 03fe faf5 f0eb e7e2 ded9 d5d0
633
-	ccc7 c3bf bbb7 b3b0 aca8 a5a2 9f9c 9996 9491 8f8d 8b89 8786
634
-	8584 8382 8181 8181 8181 8182 8384 8586 8889 8b8d 8f92 9497
635
-	9a9c 9fa3 a6a9 adb1 b4b8 bcc0 c4c9 cdd1 d6da dfe3 e8ed f1f6
636
-	fb
622
+	8084 898e 9297 9ca0 a5a9 aeb2 b6bb bfc3 c7cb ced2 d6d9 dce0
623
+	e3e5 e8eb edf0 f2f4 f6f7 f9fa fbfc fdfe fefe fefe fefe fdfc
624
+	fbfa f9f8 f6f4 f2f0 eeeb e9e6 e3e0 ddda d7d3 cfcc c8c4 c0bc
625
+	b8b3 afaa a6a1 9d98 948f 8a85 817c 7772 6e69 6460 5b57 524e
626
+	4a45 413d 3935 312e 2a27 2320 1d1a 1715 1210 0e0c 0a08 0705
627
+	0403 0202 0101 0101 0101 0202 0304 0607 090a 0c0e 1113 1518
628
+	1b1e 2124 282b 2f32 363a 3e42 464b 4f53 585c 6166 6a6f 7478
629
+	7d82 878b 9095 999e a3a7 acb0 b4b9 bdc1 c5c9 cdd0 d4d7 dbde
630
+	e1e4 e7ea ecee f1f3 f5f6 f8f9 fbfc fdfd fefe fefe fefe fdfd
631
+	fcfb faf8 f7f5 f3f1 efed eae8 e5e2 dfdc d8d5 d1ce cac6 c2be
632
+	bab5 b1ad a8a4 9f9b 9691 8d88 837e 7a75 706b 6762 5e59 5550
633
+	4c47 433f 3b37 3330 2c28 2522 1f1c 1916 1411 0f0d 0b09 0706
634
+	0504 0302 0101 0101 0101 0102 0304 0506 0809 0b0d 0f12 1417
635
+	1a1c 1f23 2629 2d31 3438 3c40 4449 4d51 565a 5f63 686d 7176
636
+	7b
637 637
 	&end
638 638
 
639 639
 @noise-wave-end
... ...
@@ -360,7 +360,7 @@ RTN
360 360
 			#03 .Screen/color DEO
361 361
 		&no-dot
362 362
 		OVR TOS .Audio0/addr DEI2 ADD2 LDA 
363
-		#02 DIV #40 ADD DUP #07 SFT #80 MUL SUB 
363
+		#02 DIV
364 364
 		TOS #0004 DIV2 .wave-view/y1 PEK2 ADD2 .Screen/y DEO2
365 365
 		.Screen/x DEI2 ++ .Screen/x DEO2
366 366
 		( draw ) OVR .Audio0/length DEI2 SWP POP GTH #02 MUL #01 ADD .Screen/color DEO
367 367
Binary files a/projects/sounds/bdr1.pcm and b/projects/sounds/bdr1.pcm differ
368 368
Binary files a/projects/sounds/bdr2.pcm and b/projects/sounds/bdr2.pcm differ
369 369
Binary files a/projects/sounds/chat.pcm and b/projects/sounds/chat.pcm differ
370 370
Binary files a/projects/sounds/cym1.pcm and b/projects/sounds/cym1.pcm differ
371 371
Binary files a/projects/sounds/kck1.pcm and b/projects/sounds/kck1.pcm differ
372 372
Binary files a/projects/sounds/kck2.pcm and b/projects/sounds/kck2.pcm differ
373 373
Binary files a/projects/sounds/ohat.pcm and b/projects/sounds/ohat.pcm differ
374 374
Binary files a/projects/sounds/pad1.pcm and b/projects/sounds/pad1.pcm differ
375 375
Binary files a/projects/sounds/ride.pcm and b/projects/sounds/ride.pcm differ
376 376
Binary files a/projects/sounds/sid1.pcm and b/projects/sounds/sid1.pcm differ
377 377
Binary files a/projects/sounds/sid2.pcm and b/projects/sounds/sid2.pcm differ
378 378
Binary files a/projects/sounds/sin.pcm and b/projects/sounds/sin.pcm differ
379 379
Binary files a/projects/sounds/snr1.pcm and b/projects/sounds/snr1.pcm differ
380 380
Binary files a/projects/sounds/snr2.pcm and b/projects/sounds/snr2.pcm differ
381 381
Binary files a/projects/sounds/sqr.pcm and b/projects/sounds/sqr.pcm differ
382 382
Binary files a/projects/sounds/sub1.pcm and b/projects/sounds/sub1.pcm differ
383 383
Binary files a/projects/sounds/syn1.pcm and b/projects/sounds/syn1.pcm differ
384 384
Binary files a/projects/sounds/syn2.pcm and b/projects/sounds/syn2.pcm differ
385 385
Binary files a/projects/sounds/tri.pcm and b/projects/sounds/tri.pcm differ
... ...
@@ -53,7 +53,7 @@ apu_render(Apu *c, Sint16 *sample, Sint16 *end)
53 53
 			}
54 54
 			c->i %= c->len;
55 55
 		}
56
-		s = (Sint8)(c->addr[c->i]) * envelope(c, c->age++);
56
+		s = (Sint8)(c->addr[c->i] + 0x80) * envelope(c, c->age++);
57 57
 		*sample++ += s * c->volume[0] / 0x180;
58 58
 		*sample++ += s * c->volume[1] / 0x180;
59 59
 	}