-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2815eb7
commit 1d40719
Showing
81 changed files
with
3,850 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.elf | ||
*.prg |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright Infringement C64 | ||
|
||
This is a port for the C64, but it's somewhat basic as the whole game has to stay in RAM. | ||
I decided to do it like so in the case i want to convert this to a cartridge game. | ||
There is a provided PRG2CRT version but it's not designed to take advantage of the mapper, it's just a straight conversion. | ||
|
||
The C64 version was quite challenging to do, and ironically the biggest challenge on this is certainly the RAM. | ||
I initially wanted to use compression with lzsa for still frames. | ||
However even if i had done that, i would have only saved 4kb as the animated frames have to be uncompressed | ||
as the C64's CPU is barely fast enough for B&W graphics. | ||
|
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
����������������������������������������������������˼������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������˼����˺�)��˼)���������˼�������ϫ�/��˲,�����������������������������������������������������������������������������������������˼���Ͽ��������������ϼ�����������ϼ�������������������������������������ϼ���������˼�������˼�����������������˼����������������������������˼��kkkk�kkk�kk��˿���{ghk��ikkkkkkkk�koo�����k | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
#14489 | ||
#15040 | ||
|
||
if [ "$#" -ne 3 ]; then | ||
echo "Usage: $0 input_file output_file sample_rate" | ||
exit 1 | ||
fi | ||
|
||
input_file="$1" | ||
output_file="$2" | ||
sample_rate="$3" | ||
|
||
temp_file="temp_8bit.wav" | ||
|
||
# Downconvert the input file with sox | ||
sox "$input_file" -c 1 -r "$sample_rate" "$temp_file" | ||
|
||
# Convert the 8-bit downconverted file to 4-bit PCM | ||
python convert_8bit_to_4bit.py "$temp_file" "$output_file" | ||
|
||
# Remove the temporary file | ||
rm "$temp_file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import sys | ||
import wave | ||
import numpy as np | ||
|
||
def convert_8bit_to_4bit(input_file, output_file): | ||
with wave.open(input_file, 'rb') as wav_in: | ||
params = wav_in.getparams() | ||
n_channels, sampwidth, framerate, n_frames = params[:4] | ||
|
||
if n_channels != 1: | ||
raise ValueError('The input WAV file should be mono') | ||
|
||
audio_data = wav_in.readframes(n_frames) | ||
audio_data = np.frombuffer(audio_data, dtype=np.uint8) | ||
|
||
# Normalize to 4-bit | ||
audio_data = audio_data >> 4 | ||
|
||
# Pack two 4-bit samples into one byte | ||
packed_data = np.zeros(n_frames // 2, dtype=np.uint8) | ||
packed_data = (audio_data[::2] << 4) | audio_data[1::2] | ||
|
||
with open(output_file, 'wb') as pcm_out: | ||
pcm_out.write(packed_data.tobytes()) | ||
|
||
if __name__ == '__main__': | ||
if len(sys.argv) < 3: | ||
print(f'Usage: python {sys.argv[0]} input_file output_file') | ||
sys.exit(1) | ||
input_file = sys.argv[1] | ||
output_file = sys.argv[2] | ||
|
||
convert_8bit_to_4bit(input_file, output_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
head -c 8000 "$1" > "$2"_bitmap.bin | ||
tail -c +8001 "$1" > "$2"_color.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
head -c 8000 "$1" > temp_bitmap.bin | ||
tail -c +8001 "$1" > temp_color.bin | ||
|
||
dd if=temp_bitmap.bin of="$2"_bitmap.bin bs=1 count=6400 | ||
dd if=temp_color.bin of="$2"_color.bin bs=1 count=1600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
python wav2c64pcm.py whatdowehave_4000.wav what.pcm | ||
python wav2c64pcm.py rikuto_4000.wav rikuto.pcm | ||
python wav2c64pcm.py fun_4000.wav fun.pcm | ||
|
||
bin2c what.pcm what_pcm.h what_pcmdata | ||
bin2c rikuto.pcm rikuto_pcm.h rikuto_pcmdata | ||
bin2c fun.pcm fun_pcm.h fun_pcmdata |
Binary file not shown.
Submodule convertron3000
added at
2db3b4
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
.global Draw_firstframe | ||
.global Draw_firstframe_color | ||
.global Draw_frame2 | ||
.global Draw_frame3 | ||
.global Draw_frame4 | ||
.global Draw_Bakura | ||
|
||
baku_bin: .incbin "bakura_bitmapc.bin" | ||
baku_c: .incbin "bakura_c.bin" | ||
|
||
source: .incbin "frame1_bitmap.bin" | ||
source1: .incbin "frame1_color.bin" | ||
source2: .incbin "frame2_bitmap.bin" | ||
source3: .incbin "frame3_bitmap.bin" | ||
source4: .incbin "frame4_bitmap.bin" | ||
;source2c: .incbin "frame2_color.bin" | ||
;source3c: .incbin "frame3_color.bin" | ||
;source4c: .incbin "frame4_color.bin" | ||
|
||
len = 6400 | ||
len1 = 1600 | ||
|
||
from = $fb | ||
to = $fd | ||
tmpx = $a6 | ||
|
||
Draw_Bakura: | ||
|
||
lda #<baku_c | ||
sta from | ||
lda #>baku_c | ||
sta from+1 | ||
lda #<$c000 | ||
sta to | ||
lda #>$c000 | ||
sta to+1 | ||
|
||
ldy #0 | ||
ldx #>len1 | ||
jsr fast_memcpy | ||
lda #<baku_bin | ||
sta from | ||
lda #>baku_bin | ||
sta from+1 | ||
lda #<$e000 | ||
sta to | ||
lda #>$e000 | ||
sta to+1 | ||
ldy #0 | ||
ldx #>len | ||
jsr fast_memcpy | ||
rts | ||
|
||
Draw_firstframe_color: | ||
|
||
lda #<source1 | ||
sta from | ||
lda #>source1 | ||
sta from+1 | ||
lda #<$c000 | ||
sta to | ||
lda #>$c000 | ||
sta to+1 | ||
|
||
ldy #0 | ||
ldx #>len1 | ||
jsr fast_memcpy | ||
rts | ||
Draw_firstframe: | ||
|
||
|
||
lda #<source | ||
sta from | ||
lda #>source | ||
sta from+1 | ||
lda #<$e000 | ||
sta to | ||
lda #>$e000 | ||
sta to+1 | ||
ldy #0 | ||
ldx #>len | ||
jsr fast_memcpy | ||
|
||
rts | ||
|
||
Draw_frame2: | ||
|
||
|
||
lda #<source2 | ||
sta from | ||
lda #>source2 | ||
sta from+1 | ||
|
||
lda #<$e000 | ||
sta to | ||
lda #>$e000 | ||
sta to+1 | ||
ldy #0 | ||
ldx #>len | ||
jsr fast_memcpy | ||
|
||
rts | ||
Draw_frame3: | ||
|
||
|
||
lda #<source3 | ||
sta from | ||
lda #>source3 | ||
sta from+1 | ||
|
||
lda #<$e000 | ||
sta to | ||
lda #>$e000 | ||
sta to+1 | ||
ldy #0 | ||
ldx #>len | ||
jsr fast_memcpy | ||
|
||
rts | ||
Draw_frame4: | ||
|
||
lda #<source4 | ||
sta from | ||
lda #>source4 | ||
sta from+1 | ||
|
||
lda #<$e000 | ||
sta to | ||
lda #>$e000 | ||
sta to+1 | ||
ldy #0 | ||
ldx #>len | ||
jsr fast_memcpy | ||
|
||
rts | ||
fast_memcpy: | ||
|
||
beq remain | ||
next: lda (from),y | ||
sta (to),y | ||
iny | ||
bne next | ||
inc from+1 | ||
inc to+1 | ||
dex | ||
bne next | ||
remain: ldx #<len | ||
beq done | ||
nextr: lda (from),y | ||
sta (to),y | ||
;iny | ||
dex | ||
bne nextr | ||
done: rts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const unsigned char font[640] = { | ||
0x05, 0x16, 0x16, 0x16, 0x16, 0x16, 0x05, 0x00, 0x40, 0x50, 0x50, 0x50, 0x50, 0x50, 0x40, 0x00, | ||
0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, | ||
0x05, 0x16, 0x00, 0x05, 0x14, 0x16, 0x15, 0x00, 0x40, 0x50, 0x50, 0x40, 0x00, 0x50, 0x50, 0x00, | ||
0x05, 0x16, 0x00, 0x05, 0x00, 0x16, 0x05, 0x00, 0x40, 0x50, 0x50, 0x40, 0x50, 0x50, 0x40, 0x00, | ||
0x16, 0x16, 0x16, 0x15, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, | ||
0x15, 0x16, 0x14, 0x15, 0x00, 0x16, 0x05, 0x00, 0x50, 0x50, 0x00, 0x40, 0x50, 0x50, 0x40, 0x00, | ||
0x05, 0x16, 0x14, 0x15, 0x16, 0x16, 0x05, 0x00, 0x40, 0x50, 0x00, 0x40, 0x50, 0x50, 0x40, 0x00, | ||
0x15, 0x16, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, | ||
0x05, 0x16, 0x16, 0x05, 0x16, 0x16, 0x05, 0x00, 0x40, 0x50, 0x50, 0x40, 0x50, 0x50, 0x40, 0x00, | ||
0x05, 0x16, 0x16, 0x05, 0x00, 0x16, 0x05, 0x00, 0x40, 0x50, 0x50, 0x50, 0x50, 0x50, 0x40, 0x00, | ||
0x05, 0x14, 0x14, 0x15, 0x14, 0x14, 0x14, 0x00, 0x50, 0x14, 0x14, 0x54, 0x14, 0x14, 0x14, 0x00, | ||
0x15, 0x14, 0x14, 0x15, 0x14, 0x14, 0x15, 0x00, 0x50, 0x14, 0x14, 0x50, 0x14, 0x14, 0x50, 0x00, | ||
0x05, 0x14, 0x14, 0x14, 0x14, 0x14, 0x05, 0x00, 0x50, 0x14, 0x00, 0x00, 0x00, 0x14, 0x50, 0x00, | ||
0x15, 0x16, 0x14, 0x14, 0x14, 0x16, 0x15, 0x00, 0x40, 0x50, 0x14, 0x14, 0x14, 0x50, 0x40, 0x00, | ||
0x15, 0x14, 0x14, 0x15, 0x14, 0x14, 0x15, 0x00, 0x54, 0x00, 0x00, 0x54, 0x00, 0x00, 0x54, 0x00, | ||
0x15, 0x14, 0x14, 0x15, 0x14, 0x14, 0x14, 0x00, 0x54, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, | ||
0x05, 0x14, 0x14, 0x16, 0x14, 0x14, 0x05, 0x00, 0x50, 0x14, 0x00, 0x54, 0x14, 0x14, 0x50, 0x00, | ||
0x14, 0x14, 0x14, 0x15, 0x14, 0x14, 0x14, 0x00, 0x14, 0x14, 0x14, 0x54, 0x14, 0x14, 0x14, 0x00, | ||
0x15, 0x01, 0x01, 0x01, 0x01, 0x01, 0x15, 0x00, 0x54, 0x40, 0x40, 0x40, 0x40, 0x40, 0x54, 0x00, | ||
0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x05, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x50, 0x00, | ||
0x14, 0x16, 0x15, 0x15, 0x15, 0x16, 0x14, 0x00, 0x14, 0x50, 0x40, 0x00, 0x40, 0x50, 0x14, 0x00, | ||
0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x00, | ||
0x56, 0x55, 0x59, 0x59, 0x50, 0x50, 0x50, 0x00, 0x50, 0x54, 0x94, 0x94, 0x14, 0x14, 0x14, 0x00, | ||
0x14, 0x15, 0x15, 0x15, 0x16, 0x14, 0x14, 0x00, 0x14, 0x94, 0x54, 0x54, 0x54, 0x14, 0x14, 0x00, | ||
0x05, 0x14, 0x14, 0x14, 0x14, 0x14, 0x05, 0x00, 0x50, 0x14, 0x14, 0x14, 0x14, 0x14, 0x50, 0x00, | ||
0x15, 0x14, 0x14, 0x15, 0x14, 0x14, 0x14, 0x00, 0x50, 0x14, 0x14, 0x50, 0x00, 0x00, 0x00, 0x00, | ||
0x05, 0x14, 0x14, 0x14, 0x14, 0x16, 0x05, 0x00, 0x50, 0x14, 0x14, 0x14, 0x14, 0x50, 0x54, 0x00, | ||
0x15, 0x14, 0x14, 0x15, 0x15, 0x16, 0x14, 0x00, 0x50, 0x14, 0x14, 0x50, 0x40, 0x50, 0x14, 0x00, | ||
0x05, 0x14, 0x14, 0x05, 0x00, 0x14, 0x05, 0x00, 0x50, 0x14, 0x00, 0x50, 0x14, 0x14, 0x50, 0x00, | ||
0x15, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x54, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, | ||
0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x05, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x50, 0x00, | ||
0x14, 0x14, 0x14, 0x14, 0x05, 0x05, 0x01, 0x00, 0x16, 0x16, 0x16, 0x16, 0x50, 0x50, 0x40, 0x00, | ||
0x50, 0x50, 0x59, 0x59, 0x59, 0x55, 0x16, 0x00, 0x14, 0x14, 0x94, 0x94, 0x94, 0x54, 0x50, 0x00, | ||
0x14, 0x14, 0x05, 0x01, 0x05, 0x14, 0x14, 0x00, 0x14, 0x14, 0x50, 0x40, 0x50, 0x14, 0x14, 0x00, | ||
0x14, 0x14, 0x14, 0x05, 0x01, 0x01, 0x01, 0x00, 0x14, 0x14, 0x14, 0x50, 0x40, 0x40, 0x40, 0x00, | ||
0x15, 0x00, 0x00, 0x01, 0x05, 0x14, 0x15, 0x00, 0x54, 0x14, 0x50, 0x40, 0x00, 0x00, 0x54, 0x00, | ||
0x05, 0x05, 0x05, 0x05, 0x05, 0x00, 0x05, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
0x01, 0x01, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
0x00, 0x05, 0x05, 0x00, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
0x05, 0x16, 0x00, 0x01, 0x05, 0x00, 0x05, 0x00, 0x40, 0x50, 0x50, 0x40, 0x00, 0x00, 0x00, 0x00 | ||
}; | ||
|
||
const int font_length = 640; |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.