cleanng out stuff from gbt pllayer and others

This commit is contained in:
Shoofle 2025-04-07 12:23:03 -04:00
parent 45ca20d569
commit b46ecb7dba
15 changed files with 0 additions and 4387 deletions

Binary file not shown.

View File

@ -1,262 +0,0 @@
; File created by shoofle's s3m2gbt edit
gb_tarot_theme1_0:
db $00, $00,
db $11, $00,
db $21, $0F,
db $31, $40,
db $12, $18,
db $22, $0F,
db $32, $40,
db $23, $00,
db $24, $00,
db $0F, $01,
db $0F, $02,
db $11, $00,
db $21, $0F,
db $31, $80,
db $12, $1C,
db $22, $0F,
db $32, $40,
db $0F, $03,
db $0F, $04,
db $11, $00,
db $21, $0F,
db $31, $C0,
db $12, $1F,
db $22, $0F,
db $32, $40,
db $0F, $05,
db $0F, $06,
db $81, $00,
db $12, $18,
db $22, $0F,
db $32, $40,
db $0F, $07,
db $0F, $08,
db $12, $1C,
db $22, $0F,
db $32, $40,
db $0F, $09,
db $0F, $0A,
db $12, $1F,
db $22, $0F,
db $32, $40,
db $0F, $0B,
db $0F, $0C,
db $11, $00,
db $21, $0F,
db $31, $00,
db $12, $18,
db $22, $0F,
db $32, $40,
db $0F, $0D,
db $0F, $0E,
db $11, $00,
db $21, $0F,
db $31, $00,
db $12, $1C,
db $22, $0F,
db $32, $40,
db $0F, $0F,
db $0F, $10,
db $11, $04,
db $21, $0F,
db $31, $40,
db $12, $1C,
db $22, $0F,
db $32, $40,
db $0F, $11,
db $0F, $12,
db $11, $04,
db $21, $0F,
db $31, $80,
db $12, $1F,
db $22, $0F,
db $32, $40,
db $0F, $13,
db $0F, $14,
db $11, $04,
db $21, $0F,
db $31, $C0,
db $12, $23,
db $22, $0F,
db $32, $40,
db $0F, $15,
db $0F, $16,
db $81, $00,
db $12, $1C,
db $22, $0F,
db $32, $40,
db $0F, $17,
db $0F, $18,
db $12, $1F,
db $22, $0F,
db $32, $40,
db $0F, $19,
db $0F, $1A,
db $12, $23,
db $22, $0F,
db $32, $40,
db $0F, $1B,
db $0F, $1C,
db $11, $04,
db $21, $0F,
db $31, $00,
db $12, $1C,
db $22, $0F,
db $32, $40,
db $0F, $1D,
db $0F, $1E,
db $11, $04,
db $21, $0F,
db $31, $00,
db $12, $1F,
db $22, $0F,
db $32, $40,
db $0F, $1F,
db $0F, $20,
db $11, $06,
db $21, $0F,
db $31, $40,
db $12, $1F,
db $22, $0F,
db $32, $40,
db $0F, $21,
db $0F, $22,
db $11, $06,
db $21, $0F,
db $31, $80,
db $22, $0C,
db $0F, $23,
db $0F, $24,
db $11, $06,
db $21, $0F,
db $31, $C0,
db $22, $0C,
db $0F, $25,
db $0F, $26,
db $81, $00,
db $22, $0C,
db $0F, $27,
db $0F, $28,
db $22, $07,
db $0F, $29,
db $0F, $2A,
db $0F, $2B,
db $0F, $2C,
db $11, $06,
db $21, $0F,
db $31, $00,
db $22, $07,
db $0F, $2D,
db $0F, $2E,
db $11, $06,
db $21, $0F,
db $31, $00,
db $0F, $2F,
db $0F, $30,
db $11, $05,
db $21, $0F,
db $31, $40,
db $22, $07,
db $0F, $31,
db $0F, $32,
db $11, $05,
db $21, $0F,
db $31, $80,
db $0F, $33,
db $0F, $34,
db $11, $05,
db $21, $0F,
db $31, $C0,
db $22, $03,
db $0F, $35,
db $0F, $36,
db $81, $00,
db $0F, $37,
db $0F, $38,
db $22, $03,
db $0F, $39,
db $0F, $3A,
db $0F, $3B,
db $0F, $3C,
db $11, $11,
db $21, $0F,
db $31, $00,
db $22, $03,
db $0F, $3D,
db $0F, $3E,
db $11, $11,
db $21, $0F,
db $31, $00,
db $0F, $3F,
gb_tarot_theme1:
db 3
dw gb_tarot_theme1_0
dw gb_tarot_theme1_0
dw gb_tarot_theme1_0

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,643 +0,0 @@
;###############################################################################
;
; GBT Player v3.1.0
;
; SPDX-License-Identifier: MIT
;
; Copyright (c) 2009-2021, Antonio Niño Díaz <antonio_nd@outlook.com>
;
;###############################################################################
INCLUDE "hardware.inc"
;###############################################################################
;
; GBT Player v3.1.0
;
; SPDX-License-Identifier: MIT
;
; Copyright (c) 2009-2020, Antonio Niño Díaz <antonio_nd@outlook.com>
;
;###############################################################################
IF !DEF(GBT_PLAYER_INC)
DEF GBT_PLAYER_INC = 1
;###############################################################################
EXPORT gbt_play ; Starts playing a song.
; de = pointer to song data
; a = default speed. Careful, 0 = 256!
; bc = data bank (b ignored if ROM with < 256 banks)
; THIS WILL CHANGE ROM BANK!!!
EXPORT gbt_pause ; Pauses or unpauses the song.
; a = 0 to pause, anything else to unpause.
EXPORT gbt_loop ; Enables/disables looping at the end of the song.
; a = 0 to stop at the end, anything else to loop
EXPORT gbt_stop ; Stops the song.
EXPORT gbt_enable_channels ; Enables given channels.
; a = channel flags ORed:
; channel 1 = 1
; channel 2 = 2
; channel 3 = 4
; channel 4 = 8
EXPORT gbt_update ; Updates the player, must be called each VBL.
; Note: This will change the active ROM bank!
; - If the following value is uncomented, the total of banks allowed is 512
; (or more), but it's a bit slower. MBC5 ONLY, DOESN'T WORK WITH OTHERS!!!
; YOU MUST USE THE -512-banks OPTION WHEN CONVERTING A SONG WITH mod2gbt!!!
; - If it's commented, only 256 banks are allowed, it's a little bit faster
; and saves a few bytes. MBC1, MBC3 and MBC5 (and others).
; DEF GBT_USE_MBC5_512BANKS = 1
;###############################################################################
ENDC ; GBT_PLAYER_INC
;###############################################################################
;###############################################################################
SECTION "GBT_VAR_1",WRAMX[$d800]
;-------------------------------------------------------------------------------
gbt_playing: DS 1
; pointer to the pattern pointer array
gbt_pattern_array_ptr: DS 2 ; LSB first
IF DEF(GBT_USE_MBC5_512BANKS)
gbt_pattern_array_bank: DS 2 ; LSB first
ELSE
gbt_pattern_array_bank: DS 1
ENDC
; playing speed
gbt_speed:: DS 1
; Up to 12 bytes per step are copied here to be handled in functions in bank 1
gbt_temp_play_data:: DS 12
gbt_loop_enabled: DS 1
gbt_ticks_elapsed:: DS 1
gbt_current_step:: DS 1
gbt_current_pattern:: DS 1
gbt_current_step_data_ptr:: DS 2 ; pointer to next step data - LSB first
IF DEF(GBT_USE_MBC5_512BANKS)
gbt_current_step_data_bank:: DS 2 ; bank of current pattern data - LSB first
ELSE
gbt_current_step_data_bank:: DS 1 ; bank of current pattern data
ENDC
gbt_channels_enabled:: DS 1
gbt_pan:: DS 4*1 ; Ch 1-4
gbt_vol:: DS 4*1 ; Ch 1-4
gbt_instr:: DS 4*1 ; Ch 1-4
gbt_freq:: DS 3*2 ; Ch 1-3
gbt_channel3_loaded_instrument:: DS 1 ; current loaded instrument ($FF if none)
; Arpeggio -> Ch 1-3
gbt_arpeggio_freq_index:: DS 3*3 ; {base index, base index+x, base index+y} * 3
gbt_arpeggio_enabled:: DS 3*1 ; if 0, disabled
gbt_arpeggio_tick:: DS 3*1
; Cut note
gbt_cut_note_tick:: DS 4*1 ; If tick == gbt_cut_note_tick, stop note.
; Last step of last pattern this is set to 1
gbt_have_to_stop_next_step:: DS 1
gbt_update_pattern_pointers:: DS 1 ; set to 1 by jump effects
;###############################################################################
SECTION "GBT_BANK0",ROM0
;-------------------------------------------------------------------------------
gbt_get_pattern_ptr:: ; a = pattern number
; loads a pointer to pattern a into gbt_current_step_data_ptr and
; gbt_current_step_data_bank
ld e,a
ld d,0
IF DEF(GBT_USE_MBC5_512BANKS)
ld a,[gbt_pattern_array_bank+0]
ld [rROMB0],a ; MBC5 - Set bank
ld a,[gbt_pattern_array_bank+1]
ld [rROMB1],a ; MBC5 - Set bank
ELSE
ld a,[gbt_pattern_array_bank]
ld [rROMB0],a ; MBC1, MBC3, MBC5 - Set bank
ENDC
ld hl,gbt_pattern_array_ptr
ld a,[hl+]
ld h,[hl]
ld l,a
; hl = pointer to list of pointers
; de = pattern number
IF DEF(GBT_USE_MBC5_512BANKS)
add hl,de
ENDC
add hl,de
add hl,de
add hl,de
; hl = pointer to pattern bank
ld a,[hl+]
ld [gbt_current_step_data_bank+0],a
IF DEF(GBT_USE_MBC5_512BANKS)
ld a,[hl+]
ld [gbt_current_step_data_bank+1],a
ENDC
; hl = pointer to pattern data
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,l
ld [gbt_current_step_data_ptr],a
ld a,h
ld [gbt_current_step_data_ptr+1],a
ret
;-------------------------------------------------------------------------------
gbt_get_pattern_ptr_banked:: ; a = pattern number
push de
call gbt_get_pattern_ptr
pop de
ld hl,gbt_current_step_data_ptr
ld a,[hl+]
ld b,a
ld a,[hl]
or a,b
jr nz,.dont_loop
xor a,a
ld [gbt_current_pattern], a
.dont_loop:
IF DEF(GBT_USE_MBC5_512BANKS)
xor a,a
ld [rROMB1],a
ENDC
ld a,$01
ld [rROMB0],a ; MBC1, MBC3, MBC5 - Set bank 1
ret
;-------------------------------------------------------------------------------
gbt_play:: ; de = data, bc = bank, a = speed
ld hl,gbt_pattern_array_ptr
ld [hl],e
inc hl
ld [hl],d
ld [gbt_speed],a
ld a,c
ld [gbt_pattern_array_bank+0],a
IF DEF(GBT_USE_MBC5_512BANKS)
ld a,b
ld [gbt_pattern_array_bank+1],a
ENDC
ld a,0
call gbt_get_pattern_ptr
xor a,a
ld [gbt_current_step],a
ld [gbt_current_pattern],a
ld [gbt_ticks_elapsed],a
ld [gbt_loop_enabled],a
ld [gbt_have_to_stop_next_step],a
ld [gbt_update_pattern_pointers],a
ld a,$FF
ld [gbt_channel3_loaded_instrument],a
ld a,$0F
ld [gbt_channels_enabled],a
ld hl,gbt_pan
ld a,$11 ; L and R
ld [hl+],a
add a,a
ld [hl+],a
add a,a
ld [hl+],a
add a,a
ld [hl],a
ld hl,gbt_vol
ld a,$F0 ; 100%
ld [hl+],a
ld [hl+],a
ld a,$20 ; 100%
ld [hl+],a
ld a,$F0 ; 100%
ld [hl+],a
ld a,0
ld hl,gbt_instr
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld hl,gbt_freq
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld [gbt_arpeggio_enabled+0],a
ld [gbt_arpeggio_enabled+1],a
ld [gbt_arpeggio_enabled+2],a
ld a,$FF
ld [gbt_cut_note_tick+0],a
ld [gbt_cut_note_tick+1],a
ld [gbt_cut_note_tick+2],a
ld [gbt_cut_note_tick+3],a
ld a,$80
ld [rNR52],a
ld a,$00
ld [rNR51],a
ld a,$00 ; 0%
ld [rNR50],a
xor a,a
ld [rNR10],a
ld [rNR11],a
ld [rNR12],a
ld [rNR13],a
ld [rNR14],a
ld [rNR21],a
ld [rNR22],a
ld [rNR23],a
ld [rNR24],a
ld [rNR30],a
ld [rNR31],a
ld [rNR32],a
ld [rNR33],a
ld [rNR34],a
ld [rNR41],a
ld [rNR42],a
ld [rNR43],a
ld [rNR44],a
ld a,$77 ; 100%
ld [rNR50],a
ld a,$01
ld [gbt_playing],a
ret
;-------------------------------------------------------------------------------
gbt_pause:: ; a = pause/unpause
ld [gbt_playing],a
or a,a
jr nz,.gbt_pause_unmute
; Silence all channels
xor a,a
ld [rNR51],a
ret
.gbt_pause_unmute: ; Unmute sound if playback is resumed
; Restore panning status
ld hl,gbt_pan
ld a,[hl+]
or a,[hl]
inc hl
or a,[hl]
inc hl
or a,[hl]
ld [rNR51],a
ret
;-------------------------------------------------------------------------------
gbt_loop:: ; a = loop/don't loop
ld [gbt_loop_enabled],a
ret
;-------------------------------------------------------------------------------
gbt_stop::
xor a,a
ld [gbt_playing],a
ld [rNR50],a
ld [rNR51],a
ld [rNR52],a
ret
;-------------------------------------------------------------------------------
gbt_enable_channels:: ; a = channel flags (channel flag = (1<<(channel_num-1)))
ld [gbt_channels_enabled],a
ret
;-------------------------------------------------------------------------------
EXPORT gbt_update_bank1
gbt_update::
ld a,[gbt_playing]
or a,a
ret z ; If not playing, return
; Handle tick counter
ld hl,gbt_ticks_elapsed
ld a,[gbt_speed] ; a = total ticks
ld b,[hl] ; b = ticks elapsed
inc b
ld [hl],b
cp a,b
jr z,.dontexit
; Tick != Speed, update effects and exit
IF DEF(GBT_USE_MBC5_512BANKS)
xor a,a
ld [rROMB1],a
ENDC
ld a,$01
ld [rROMB0],a ; MBC1, MBC3, MBC5 - Set bank 1
; Call update function in bank 1 (in gbt_player_bank1.s)
call gbt_update_effects_bank1
ret
.dontexit:
ld [hl],$00 ; reset tick counter
; Clear tick-based effects
; ------------------------
xor a,a
ld hl,gbt_arpeggio_enabled ; Disable arpeggio
ld [hl+],a
ld [hl+],a
ld [hl],a
dec a ; a = $FF
ld hl,gbt_cut_note_tick ; Disable cut note
ld [hl+],a
ld [hl+],a
ld [hl+],a
ld [hl],a
; Update effects
; --------------
IF DEF(GBT_USE_MBC5_512BANKS)
xor a,a
ld [rROMB1],a
ENDC
ld a,$01
ld [rROMB0],a ; MBC1, MBC3, MBC5 - Set bank 1
; Call update function in bank 1 (in gbt_player_bank1.s)
call gbt_update_effects_bank1
; Check if last step
; ------------------
ld a,[gbt_have_to_stop_next_step]
or a,a
jr z,.dont_stop
call gbt_stop
ld a,0
ld [gbt_have_to_stop_next_step],a
ret
.dont_stop:
; Get this step data
; ------------------
; Change to bank with song data
IF DEF(GBT_USE_MBC5_512BANKS)
ld a,[gbt_current_step_data_bank+0]
ld [rROMB0],a ; MBC5 - Set bank
ld a,[gbt_current_step_data_bank+1]
ld [rROMB1],a ; MBC5 - Set bank
ELSE
ld a,[gbt_current_step_data_bank]
ld [rROMB0],a ; MBC1, MBC3, MBC5 - Set bank
ENDC
; Get step data
ld a,[gbt_current_step_data_ptr]
ld l,a
ld a,[gbt_current_step_data_ptr+1]
ld h,a ; hl = pointer to data
ld de,gbt_temp_play_data
ld b,4
.copy_loop: ; copy as bytes as needed for this step
ld a,[hl+]
ld [de],a
inc de
bit 7,a
jr nz,.more_bytes
bit 6,a
jr z,.no_more_bytes_this_channel
jr .one_more_byte
.more_bytes:
ld a,[hl+]
ld [de],a
inc de
bit 7,a
jr z,.no_more_bytes_this_channel
.one_more_byte:
ld a,[hl+]
ld [de],a
inc de
.no_more_bytes_this_channel:
dec b
jr nz,.copy_loop
ld a,l
ld [gbt_current_step_data_ptr],a
ld a,h
ld [gbt_current_step_data_ptr+1],a ; save pointer to data
; Increment step/pattern
; ----------------------
; Increment step
ld a,[gbt_current_step]
inc a
ld [gbt_current_step],a
cp a,64
jr nz,.dont_increment_pattern
; Increment pattern
ld a,0
ld [gbt_current_step],a ; Step 0
ld a,[gbt_current_pattern]
inc a
ld [gbt_current_pattern],a
call gbt_get_pattern_ptr
ld a,[gbt_current_step_data_ptr]
ld b,a
ld a,[gbt_current_step_data_ptr+1]
or a,b
jr nz,.not_ended ; if pointer is 0, song has ended
ld a,[gbt_loop_enabled]
and a,a
jr z,.loop_disabled
; If loop is enabled, jump to pattern 0
ld a,0
ld [gbt_current_pattern],a
call gbt_get_pattern_ptr
jr .end_handling_steps_pattern
.loop_disabled:
; If loop is disabled, stop song
; Stop it next step, if not this step won't be played
ld a,1
ld [gbt_have_to_stop_next_step],a
.not_ended:
.dont_increment_pattern:
.end_handling_steps_pattern:
IF DEF(GBT_USE_MBC5_512BANKS)
xor a,a
ld [rROMB1],a ; MBC5
ENDC
ld a,$01
ld [rROMB0],a ; MBC1, MBC3, MBC5 - Set bank 1
; Call update function in bank 1 (in gbt_player_bank1.s)
call gbt_update_bank1
; Check if any effect has changed the pattern or step
ld a,[gbt_update_pattern_pointers]
and a,a
ret z
; if any effect has changed the pattern or step, update
xor a,a
ld [gbt_update_pattern_pointers],a ; clear update flag
ld [gbt_have_to_stop_next_step],a ; clear stop flag
ld a,[gbt_current_pattern]
call gbt_get_pattern_ptr ; set ptr to start of the pattern
; Search the step
; Change to bank with song data
IF DEF(GBT_USE_MBC5_512BANKS)
ld a,[gbt_pattern_array_bank+1]
ld [rROMB1],a ; MBC5
ENDC
ld a,[gbt_pattern_array_bank+0]
ld [rROMB0],a ; MBC1, MBC3, MBC5
ld a,[gbt_current_step_data_ptr]
ld l,a
ld a,[gbt_current_step_data_ptr+1]
ld h,a ; hl = pointer to data
ld a,[gbt_current_step]
and a,a
ret z ; if changing to step 0, exit
add a,a
add a,a
ld b,a ; b = iterations = step * 4 (number of channels)
.next_channel:
ld a,[hl+]
bit 7,a
jr nz,.next_channel_more_bytes
bit 6,a
jr z,.next_channel_no_more_bytes_this_channel
jr .next_channel_one_more_byte
.next_channel_more_bytes:
ld a,[hl+]
bit 7,a
jr z,.next_channel_no_more_bytes_this_channel
.next_channel_one_more_byte:
ld a,[hl+]
.next_channel_no_more_bytes_this_channel:
dec b
jr nz,.next_channel
ld a,l
ld [gbt_current_step_data_ptr],a
ld a,h
ld [gbt_current_step_data_ptr+1],a ; save pointer to data
ret
;###############################################################################

File diff suppressed because it is too large Load Diff

View File

@ -1,203 +0,0 @@
; File created by shoofle's s3m2gbt edit
gbtarottheme_0:
db $00, $00,
db $11, $0C,
db $21, $0F,
db $31, $40,
db $22, $00,
db $23, $00,
db $24, $00,
db $0F, $01,
db $0F, $02,
db $11, $0C,
db $21, $0F,
db $31, $80,
db $0F, $03,
db $0F, $04,
db $11, $0C,
db $21, $0F,
db $31, $C0,
db $0F, $05,
db $0F, $06,
db $81, $FE,
db $0F, $07,
db $0F, $08,
db $0F, $09,
db $0F, $0A,
db $0F, $0B,
db $0F, $0C,
db $11, $0C,
db $21, $0F,
db $31, $00,
db $0F, $0D,
db $0F, $0E,
db $11, $0C,
db $21, $0F,
db $31, $00,
db $0F, $0F,
db $0F, $10,
db $11, $10,
db $21, $0F,
db $31, $40,
db $0F, $11,
db $0F, $12,
db $11, $10,
db $21, $0F,
db $31, $80,
db $0F, $13,
db $0F, $14,
db $11, $10,
db $21, $0F,
db $31, $C0,
db $0F, $15,
db $0F, $16,
db $81, $FE,
db $0F, $17,
db $0F, $18,
db $0F, $19,
db $0F, $1A,
db $0F, $1B,
db $0F, $1C,
db $11, $10,
db $21, $0F,
db $31, $00,
db $0F, $1D,
db $0F, $1E,
db $11, $10,
db $21, $0F,
db $31, $00,
db $0F, $1F,
db $0F, $20,
db $11, $12,
db $21, $0F,
db $31, $40,
db $0F, $21,
db $0F, $22,
db $11, $12,
db $21, $0F,
db $31, $80,
db $0F, $23,
db $0F, $24,
db $11, $12,
db $21, $0F,
db $31, $C0,
db $0F, $25,
db $0F, $26,
db $81, $FE,
db $0F, $27,
db $0F, $28,
db $0F, $29,
db $0F, $2A,
db $0F, $2B,
db $0F, $2C,
db $11, $12,
db $21, $0F,
db $31, $00,
db $0F, $2D,
db $0F, $2E,
db $11, $12,
db $21, $0F,
db $31, $00,
db $0F, $2F,
db $0F, $30,
db $11, $11,
db $21, $0F,
db $31, $40,
db $0F, $31,
db $0F, $32,
db $11, $11,
db $21, $0F,
db $31, $80,
db $0F, $33,
db $0F, $34,
db $11, $11,
db $21, $0F,
db $31, $C0,
db $0F, $35,
db $0F, $36,
db $81, $FE,
db $0F, $37,
db $0F, $38,
db $0F, $39,
db $0F, $3A,
db $0F, $3B,
db $0F, $3C,
db $11, $11,
db $21, $0F,
db $31, $00,
db $0F, $3D,
db $0F, $3E,
db $11, $11,
db $21, $0F,
db $31, $00,
db $0F, $3F,
gbtarottheme:
db 4
dw gbtarottheme_0
dw gbtarottheme_0
dw gbtarottheme_0

View File

@ -1,217 +0,0 @@
; s3m2gbt modified by shoofle to output rgbds-compatible asm filespythonrangetest_0:
db 0xBF,0x00,0x30,0x10,0x10,0x10,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x01,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x02,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x03,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x04,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x05,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x06,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x07,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x08,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x09,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x0A,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x0B,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x0C,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x0D,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x0E,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x0F,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x10,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x11,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x12,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x13,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x14,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x15,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x16,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x17,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x18,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x19,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x1A,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x1B,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x1C,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x1D,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x1E,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x1F,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
pythonrangetest_1:
db 0xBF,0x20,0x30,0x10,0x10,0x10,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x21,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x22,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x23,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x24,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x25,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x26,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x27,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x28,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x29,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x2A,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x2B,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x2C,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x2D,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x2E,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x2F,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x30,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x31,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x32,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x33,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x34,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x35,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x36,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x37,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x38,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x39,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x3A,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x3B,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x3C,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x3D,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x3E,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x3F,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
pythonrangetest_2:
db 0xBF,0x40,0x30,0x10,0x10,0x10,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x41,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x42,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x43,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x44,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x45,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x46,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0xBF,0x47,0x30,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
db 0x00,0x00,0x00,0x00,
pythonrangetest_init_state:
db 0x01,0x06,0x02,0x11,0x22,0x44,0x88,0x00,
pythonrangetest:
db BANK(pythonrangetest_0)
dw pythonrangetest_0
db BANK(pythonrangetest_1)
dw pythonrangetest_1
db BANK(pythonrangetest_2)
dw pythonrangetest_2
db $00
dw $0000

View File

@ -1,222 +0,0 @@
; s3m2gbt modified by shoofle to output rgbds-compatible asm files
SECTION "pythonrangetest_0", ROMX
pythonrangetest_0:
db $BF,$00,$30,$10,$10,$10,
db $00,$00,$00,$00,
db $BF,$01,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$02,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$03,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$04,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$05,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$06,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$07,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$08,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$09,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$0A,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$0B,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$0C,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$0D,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$0E,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$0F,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$10,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$11,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$12,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$13,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$14,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$15,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$16,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$17,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$18,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$19,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$1A,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$1B,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$1C,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$1D,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$1E,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$1F,$30,$00,$00,$00,
db $00,$00,$00,$00,
SECTION "pythonrangetest_1", ROMX
pythonrangetest_1:
db $BF,$20,$30,$10,$10,$10,
db $00,$00,$00,$00,
db $BF,$21,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$22,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$23,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$24,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$25,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$26,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$27,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$28,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$29,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$2A,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$2B,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$2C,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$2D,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$2E,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$2F,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$30,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$31,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$32,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$33,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$34,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$35,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$36,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$37,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$38,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$39,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$3A,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$3B,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$3C,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$3D,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$3E,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$3F,$30,$00,$00,$00,
db $00,$00,$00,$00,
SECTION "pythonrangetest_2", ROMX
pythonrangetest_2:
db $BF,$40,$30,$10,$10,$10,
db $00,$00,$00,$00,
db $BF,$41,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$42,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$43,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$44,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$45,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$46,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $BF,$47,$30,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
db $00,$00,$00,$00,
pythonrangetest_init_state:
db 0x01,0x06,0x02,0x11,0x22,0x44,0x88,0x00,
SECTION "pythonrangetest", ROMX
pythonrangetest:
db BANK(pythonrangetest_0)
dw pythonrangetest_0
db BANK(pythonrangetest_1)
dw pythonrangetest_1
db BANK(pythonrangetest_2)
dw pythonrangetest_2
db $00
dw $0000

Binary file not shown.

View File

@ -1,672 +0,0 @@
; File created by shoofle's s3m2gbt edit
rangetest_0:
db $00, $00,
db $11, $00,
db $21, $0F,
db $31, $40,
db $22, $00,
db $23, $00,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $01,
db $84, $00,
db $0F, $02,
db $21, $00,
db $0F, $03,
db $0F, $04,
db $11, $02,
db $21, $0E,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $05,
db $84, $00,
db $0F, $06,
db $21, $00,
db $0F, $07,
db $0F, $08,
db $11, $04,
db $21, $0C,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $09,
db $84, $00,
db $0F, $0A,
db $21, $00,
db $0F, $0B,
db $0F, $0C,
db $11, $06,
db $21, $0A,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $0D,
db $84, $00,
db $0F, $0E,
db $21, $09,
db $0F, $0F,
db $0F, $10,
db $11, $08,
db $21, $08,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $11,
db $84, $00,
db $0F, $12,
db $21, $07,
db $0F, $13,
db $0F, $14,
db $11, $0A,
db $21, $06,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $15,
db $84, $00,
db $0F, $16,
db $11, $0B,
db $21, $05,
db $31, $C0,
db $0F, $17,
db $0F, $18,
db $11, $0C,
db $21, $04,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $19,
db $84, $00,
db $0F, $1A,
db $11, $0D,
db $21, $03,
db $31, $C0,
db $0F, $1B,
db $0F, $1C,
db $11, $0E,
db $21, $02,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $1D,
db $84, $00,
db $0F, $1E,
db $11, $0F,
db $21, $01,
db $31, $C0,
db $0F, $1F,
db $0F, $20,
db $11, $10,
db $21, $00,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $21,
db $84, $00,
db $0F, $22,
db $11, $11,
db $21, $0F,
db $31, $C0,
db $0F, $23,
db $0F, $24,
db $11, $12,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $25,
db $84, $00,
db $0F, $26,
db $11, $13,
db $21, $0F,
db $31, $C0,
db $0F, $27,
db $0F, $28,
db $11, $14,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $29,
db $84, $00,
db $0F, $2A,
db $11, $15,
db $21, $0F,
db $31, $C0,
db $0F, $2B,
db $0F, $2C,
db $11, $16,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $2D,
db $84, $00,
db $0F, $2E,
db $11, $17,
db $21, $0F,
db $31, $C0,
db $0F, $2F,
db $0F, $30,
db $11, $18,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $31,
db $84, $00,
db $0F, $32,
db $11, $19,
db $21, $0F,
db $31, $C0,
db $0F, $33,
db $0F, $34,
db $11, $1A,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $35,
db $84, $00,
db $0F, $36,
db $11, $1B,
db $21, $0F,
db $31, $C0,
db $0F, $37,
db $0F, $38,
db $11, $1C,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $39,
db $84, $00,
db $0F, $3A,
db $11, $1D,
db $21, $0F,
db $31, $C0,
db $0F, $3B,
db $0F, $3C,
db $11, $1E,
db $21, $0F,
db $31, $C0,
db $14, $18,
db $24, $0F,
db $34, $00,
db $0F, $3D,
db $84, $00,
db $0F, $3E,
db $11, $1F,
db $21, $0F,
db $31, $C0,
db $0F, $3F,
rangetest_1:
db $00, $00,
db $11, $20,
db $21, $0F,
db $31, $C0,
db $22, $00,
db $23, $00,
db $24, $00,
db $0F, $01,
db $0F, $02,
db $11, $21,
db $21, $0F,
db $31, $C0,
db $0F, $03,
db $0F, $04,
db $11, $22,
db $21, $0F,
db $31, $C0,
db $0F, $05,
db $0F, $06,
db $11, $23,
db $21, $0F,
db $31, $C0,
db $0F, $07,
db $0F, $08,
db $11, $24,
db $21, $0F,
db $31, $C0,
db $0F, $09,
db $0F, $0A,
db $11, $25,
db $21, $0F,
db $31, $C0,
db $0F, $0B,
db $0F, $0C,
db $11, $26,
db $21, $0F,
db $31, $C0,
db $0F, $0D,
db $0F, $0E,
db $11, $27,
db $21, $0F,
db $31, $C0,
db $0F, $0F,
db $0F, $10,
db $11, $28,
db $21, $0F,
db $31, $C0,
db $0F, $11,
db $0F, $12,
db $11, $29,
db $21, $0F,
db $31, $C0,
db $0F, $13,
db $0F, $14,
db $11, $2A,
db $21, $0F,
db $31, $C0,
db $0F, $15,
db $0F, $16,
db $11, $2B,
db $21, $0F,
db $31, $C0,
db $0F, $17,
db $0F, $18,
db $11, $2C,
db $21, $0F,
db $31, $C0,
db $0F, $19,
db $0F, $1A,
db $11, $2D,
db $21, $0F,
db $31, $C0,
db $0F, $1B,
db $0F, $1C,
db $11, $2E,
db $21, $0F,
db $31, $C0,
db $0F, $1D,
db $0F, $1E,
db $11, $2F,
db $21, $0F,
db $31, $C0,
db $0F, $1F,
db $0F, $20,
db $11, $30,
db $21, $0F,
db $31, $C0,
db $0F, $21,
db $0F, $22,
db $11, $31,
db $21, $0F,
db $31, $C0,
db $0F, $23,
db $0F, $24,
db $11, $32,
db $21, $0F,
db $31, $C0,
db $0F, $25,
db $0F, $26,
db $11, $33,
db $21, $0F,
db $31, $C0,
db $0F, $27,
db $0F, $28,
db $11, $34,
db $21, $0F,
db $31, $C0,
db $0F, $29,
db $0F, $2A,
db $11, $35,
db $21, $0F,
db $31, $C0,
db $0F, $2B,
db $0F, $2C,
db $11, $36,
db $21, $0F,
db $31, $C0,
db $0F, $2D,
db $0F, $2E,
db $11, $37,
db $21, $0F,
db $31, $C0,
db $0F, $2F,
db $0F, $30,
db $11, $38,
db $21, $0F,
db $31, $C0,
db $0F, $31,
db $0F, $32,
db $11, $39,
db $21, $0F,
db $31, $C0,
db $0F, $33,
db $0F, $34,
db $11, $3A,
db $21, $0F,
db $31, $C0,
db $0F, $35,
db $0F, $36,
db $11, $3B,
db $21, $0F,
db $31, $C0,
db $0F, $37,
db $0F, $38,
db $11, $3C,
db $21, $0F,
db $31, $C0,
db $0F, $39,
db $0F, $3A,
db $11, $3D,
db $21, $0F,
db $31, $C0,
db $0F, $3B,
db $0F, $3C,
db $11, $3E,
db $21, $0F,
db $31, $C0,
db $0F, $3D,
db $0F, $3E,
db $11, $3F,
db $21, $0F,
db $31, $C0,
db $0F, $3F,
rangetest_2:
db $00, $00,
db $11, $40,
db $21, $0B,
db $31, $80,
db $22, $00,
db $23, $00,
db $24, $00,
db $0F, $01,
db $0F, $02,
db $11, $41,
db $21, $0B,
db $31, $80,
db $0F, $03,
db $0F, $04,
db $11, $42,
db $21, $0B,
db $31, $80,
db $0F, $05,
db $0F, $06,
db $11, $43,
db $21, $0B,
db $31, $80,
db $0F, $07,
db $0F, $08,
db $11, $44,
db $21, $0B,
db $31, $80,
db $0F, $09,
db $0F, $0A,
db $11, $45,
db $21, $0B,
db $31, $80,
db $0F, $0B,
db $0F, $0C,
db $11, $46,
db $21, $0B,
db $31, $80,
db $0F, $0D,
db $0F, $0E,
db $11, $47,
db $21, $0B,
db $31, $80,
db $0F, $0F,
db $0F, $10,
db $0F, $11,
db $0F, $12,
db $0F, $13,
db $0F, $14,
db $0F, $15,
db $0F, $16,
db $0F, $17,
db $0F, $18,
db $0F, $19,
db $0F, $1A,
db $0F, $1B,
db $0F, $1C,
db $0F, $1D,
db $0F, $1E,
db $0F, $1F,
db $0F, $20,
db $0F, $21,
db $0F, $22,
db $0F, $23,
db $0F, $24,
db $0F, $25,
db $0F, $26,
db $0F, $27,
db $0F, $28,
db $0F, $29,
db $0F, $2A,
db $0F, $2B,
db $0F, $2C,
db $0F, $2D,
db $0F, $2E,
db $0F, $2F,
db $0F, $30,
db $0F, $31,
db $0F, $32,
db $0F, $33,
db $0F, $34,
db $0F, $35,
db $0F, $36,
db $0F, $37,
db $0F, $38,
db $0F, $39,
db $0F, $3A,
db $0F, $3B,
db $0F, $3C,
db $0F, $3D,
db $0F, $3E,
db $0F, $3F,
rangetest:
db 4
dw rangetest_0
dw rangetest_1
dw rangetest_2

Binary file not shown.

Binary file not shown.

View File

@ -1,779 +0,0 @@
#!/usr/bin/env python3
# s3m2gbt v4.4.1 (Part of GBT Player)
#
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2022 Antonio Niño Díaz <antonio_nd@outlook.com>
class RowConversionError(Exception):
def __init__(self, message, pattern = -1, row = -1, channel = -1):
self.pattern = pattern
self.row = row
self.channel = channel + 1
self.message = message
def __str__(self):
return f"Pattern {self.pattern} | Row {self.row} | Channel {self.channel} | {self.message}"
class S3MFormatError(Exception):
pass
class S3MFormatReader:
def read_u8(self):
offset = self.read_ptr
self.read_ptr += 1
return int(self.data[offset])
def read_u16(self):
offset = self.read_ptr
self.read_ptr += 2
return int((self.data[offset + 1] << 8) | self.data[offset])
def read_memseg(self):
offset = self.read_ptr
self.read_ptr += 3
part1 = self.data[offset + 0]
part2 = self.data[offset + 1]
part3 = self.data[offset + 2]
return int((part1 << 16) | (part3 << 8) | part2)
def read_string(self, size):
offset = self.read_ptr
self.read_ptr += size
return self.data[offset:offset+size]
class S3MFileInstrument(S3MFormatReader):
def __init__(self, data, offset):
self.data = data
self.read_ptr = offset
instrument_type = self.read_u8()
if instrument_type != 1:
self.exists = False
return
self.exists = True
self.dos_filename = self.read_string(12).decode("utf-8")
self.sample_data_offset = self.read_memseg() * 16
self.length = self.read_u16()
self.length |= self.read_u16() << 16
self.read_ptr += 4 + 4 # Skip loop begin and loop end
self.default_volume = self.read_u8()
self.read_ptr = offset + 0x30
self.sample_name = self.read_string(28).decode("utf-8")
if self.read_string(4) != b'SCRS':
raise S3MFormatError("Invalid magic string in instrument")
start = self.sample_data_offset
end = start + self.length
self.sample_data = self.data[start:end]
class S3MFilePatternCell():
def __init__(self, header, channel, note, instrument, volume,
effect, effect_args):
if header == 0:
self.empty = True
return
self.empty = False
self.channel = channel
if (note != None) or (instrument != None):
self.has_note_and_instrument = True
self.note = note
self.instrument = instrument
else:
self.has_note_and_instrument = False
if volume != None:
self.has_volume = True
self.volume = volume
else:
self.has_volume = False
if (effect != None) or (effect_args != None):
self.has_effect = True
self.effect = effect
self.effect_args = effect_args
else:
self.has_effect = False
class S3MFilePattern(S3MFormatReader):
def __init__(self, data, offset):
# Check if we have asked to generate an empty pattern
if data == None:
cell = S3MFilePatternCell(0, 0, 0, 0, 0, 0, 0)
self.cells = []
for i in range(0, 64):
self.cells.append(cell)
return
self.data = data
self.read_ptr = offset
length = self.read_u16() - 2
self.cells = []
while length > 0:
header = self.read_u8()
length -= 1
channel = header & 31
note = None
instrument = None
volume = None
effect = None
effect_args = None
if (header & (1 << 5)) != 0: # Has note and instrument
note = self.read_u8()
instrument = self.read_u8()
length -= 2
if (header & (1 << 6)) != 0: # Has volume
volume = self.read_u8()
length -= 1
if (header & (1 << 7)) != 0: # Has effect
effect = self.read_u8()
effect_args = self.read_u8()
length -= 2
cell = S3MFilePatternCell(header, channel, note, instrument, volume,
effect, effect_args)
self.cells.append(cell)
class S3MFile(S3MFormatReader):
def __init__(self, data):
# Save data for now
self.data = data
self.read_ptr = 0
self.name = self.read_string(28).decode("utf-8")
print(f"Song Name: '{self.name}'")
self.read_ptr += 1 + 1 + 2 # Ignore fields
self.song_length = self.read_u16()
print(f"Song Length: {self.song_length}")
self.num_instruments = self.read_u16()
self.num_patterns = self.read_u16()
self.read_ptr += 6 # Ignore fields
if self.read_string(4) != b'SCRM':
raise S3MFormatError("Invalid magic string in file")
self.global_volume = self.read_u8()
self.initial_speed = self.read_u8()
if self.read_u8() != 150:
raise S3MFormatError("Invalid tempo: It must be 150")
self.master_volume = self.read_u8() & 0b00111111 # master volume
self.read_ptr += 1 # Ignore ultraclick removal
# Save this for later
has_custom_pan = False
if self.read_u8() == 252:
has_custom_pan = True
self.read_ptr = 0x40 # jump forward to uint8[32] channelSettings
channel_settings = self.read_string(4)
if channel_settings[0] >= 16 or channel_settings[1] >= 16 or \
channel_settings[2] >= 16 or channel_settings[3] >= 16:
raise S3MFormatError("Invalid channel settings: Channels 0-3 must be enabled")
# Read orders
self.read_ptr = 0x60 # jump forward to uint8[orderCount] orderList
self.song_orders = self.read_string(self.song_length)
if self.song_length % 2 == 1:
self.read_ptr += 1 # Align to 2
# Read instrument parapointers
self.instrument_offsets = [None] * self.num_instruments
for i in range(0, self.num_instruments):
self.instrument_offsets[i] = self.read_u16() * 16
# Read pattern parapointers
self.pattern_offsets = [None] * self.num_patterns
for i in range(0, self.num_patterns):
self.pattern_offsets[i] = self.read_u16() * 16
# Read default panning
if has_custom_pan:
self.channel_pan = [b & 0xF for b in self.read_string(4)]
else:
self.channel_pan = [8, 8, 8, 8]
# Load instruments
self.instruments = [None] * self.num_instruments
for i in range(0, len(self.instrument_offsets)):
offset = self.instrument_offsets[i]
if offset != 0:
instr = S3MFileInstrument(self.data, offset)
if instr.exists:
self.instruments[i] = instr
# Load patterns
self.patterns = [None] * self.num_patterns
for i in range(0, len(self.pattern_offsets)):
offset = self.pattern_offsets[i]
if offset != 0:
self.patterns[i] = S3MFilePattern(self.data, offset)
else:
# A NULL pointer means that the pattern is empty
self.patterns[i] = S3MFilePattern(None, 0)
# The file data is no longer needed
self.data = []
# Channels 1, 2, 4
def s3m_volume_to_gb(s3m_vol): # this is identical to mod files.
if s3m_vol >= 64:
return 15
else:
return s3m_vol >> 2;
# Channel 3
def s3m_volume_to_gb_ch3(s3m_vol): # also identicll to mod files
vol = s3m_volume_to_gb(s3m_vol)
if vol >= 0 and vol <= 3:
return 0 # 0%
elif vol >= 4 and vol <= 6:
return 3 # 25%
elif vol >= 7 and vol <= 9:
return 2 # 50%
elif vol >= 10 and vol <= 12:
return 4 # 75%
elif vol >= 13 and vol <= 15:
return 1 # 100%
else:
return 0
def s3m_note_to_gb(note):
# Note cut with ^^
if note == 0xFE:
return 0xFE
# Note off and ^^ note cut should be handled before reaching this point
assert note <= 0x7F
note -= 32
if note < 0:
raise RowConversionError("Note too low")
elif note > 32 + 16 * 6:
raise RowConversionError("Note too high")
note = (note & 0xF) + ((note & 0xF0) >> 4) * 12
return note
def s3m_pan_to_gb(pan, channel):
left = False
right = False
if pan >= 0 and pan <= 3:
left = True
elif pan >= 4 and pan <= 11:
left = True
right = True
elif pan >= 12 and pan <= 15:
right = True
val = 0
if left:
val |= 1 << (3 + channel)
if right:
val |= 1 << (channel - 1)
return val
EFFECT_PAN = 0
EFFECT_ARPEGGIO = 1
EFFECT_NOTE_CUT = 2
EFFECT_VIBRATO = 3
EFFECT_VOLUME_SLIDE = 4
EFFECT_PATTERN_JUMP = 8
EFFECT_BREAK_SET_STEP = 9
EFFECT_SPEED = 10
EFFECT_EVENT = 15
# Returns (converted_num, converted_params) if there was a valid effect. If
# there is none, it returns (None, None). Note that it is needed to pass the
# channel to this function because some effects behave differently depending on
# the channel (like panning).
def effect_s3m_to_gb(channel, effectnum, effectparams):
if effectnum == 'A': # Set Speed. compatible
if effectparams > 0x1F:
raise RowConversionError("Unsupported BPM speed effect")
if effectparams == 0:
raise RowConversionError("Speed must not be zero")
return (EFFECT_SPEED, effectparams)
if effectnum == 'B': # Pattern jump compatible
# TODO: Fail if this jumps out of bounds
return (EFFECT_PATTERN_JUMP, effectparams)
elif effectnum == 'C': # Break + Set row compatiblle
# Effect value is BCD, convert to integer
val = (((effectparams & 0xF0) >> 4) * 10) + (effectparams & 0x0F)
return (EFFECT_BREAK_SET_STEP, val)
elif effectnum == 'D': # Volume Slide not present in .mod
if channel == 3:
raise RowConversionError("Volume slide not supported in channel 3")
if effectparams == 0:
# Ignore volume slide commands that just continue the effect,
# they are only needed for the S3M player.
return (None, None)
upper = (effectparams >> 4) & 0xF
lower = effectparams & 0xF
if upper == 0xF or lower == 0xF:
raise RowConversionError("Fine volume slide not supported")
elif lower == 0: # Volume goes up
params = 1 << 3 # Increase
delay = 7 - upper + 1
if delay <= 0:
raise RowConversionError("Volume slide too steep")
params |= delay
return (EFFECT_VOLUME_SLIDE, params)
elif upper == 0: # Volume goes down
params = 0 << 3 # Decrease
delay = 7 - lower + 1
if delay <= 0:
raise RowConversionError("Volume slide too steep")
params = delay
return (EFFECT_VOLUME_SLIDE, params)
else:
raise RowConversionError("Invalid volume slide arguments")
return (EFFECT_VOLUME_SLIDE, effectparams)
elif effectnum == 'H': # Vibrato
return (EFFECT_VIBRATO, effectparams)
elif effectnum == 'J': # Arpeggio
return (EFFECT_ARPEGGIO, effectparams)
elif effectnum == 'S': # This effect is subdivided into many
subeffectnum = (effectparams & 0xF0) >> 4
subeffectparams = effectparams & 0x0F
if subeffectnum == 0x8: # Pan position compatible
val = s3m_pan_to_gb(subeffectparams, channel)
return (EFFECT_PAN, val)
elif subeffectnum == 0xC: # Notecut compatible
print(f"fofund a note cut, {effectnum}, {subeffectnum}, {subeffectparams}")
return (EFFECT_NOTE_CUT, subeffectparams)
elif subeffectnum == 0xF: # Funkrepeat? Set active macro? not present in .mod
# This effect is either unused, or it's the "set active macro"
# command, which doesn't have any effect if you don't use the macro
# afterwards. It can safely be overloaded for event callbacks.
return (EFFECT_EVENT, subeffectparams)
raise RowConversionError(f"Unsupported effect: {effectnum}{effectparams:02X}")
HAS_VOLUME = 1 << 5 # changing these to be compatible with old gbt
HAS_DRUM_EFFECT = 1 << 6
HAS_EFFECT = 1 << 7
HAS_NOTE = 1 << 7
HAS_KIT = 1 << 7
def convert_channel(channel, note_index, samplenum, volume, effectnum, effectparams):
#print(f"{channel}: {note_index}, using {samplenum} @ volume {volume}")
if channel == 4:
return convert_channel4(note_index, samplenum, volume, effectnum, effectparams)
command = [ 0, 0, 0 ] # NOP
command_len = 1
if channel == 3:
shifted_instrument = (samplenum) << 7
converted_volume = s3m_volume_to_gb_ch3(volume)
else:
shifted_instrument = (samplenum & 3) << 4
converted_volume = s3m_volume_to_gb(volume)
# Check if it's needed to add a note
if note_index != -1:
command[0] = HAS_NOTE | note_index
command[1] = shifted_instrument | converted_volume
command_len = 2
if effectnum is not None:
[num, params] = effect_s3m_to_gb(channel, effectnum, effectparams)
command[1] = HAS_EFFECT | shifted_instrument | num
command[2] = params
command_len = 3
else:
command[0] = HAS_VOLUME | converted_volume
command_len = 1
if effectnum is not None:
[num, params] = effect_s3m_to_gb(channel, effectnum, effectparams)
command[1] = HAS_EFFECT | shifted_instrument | num
command[2] = params
command_len = 3
return command[:command_len]
def convert_channel4(note_index, samplenum, volume, effectnum, effectparams):
command = [ 0, 0, 0 ] # NOP
command_len = 1
#print(f"we found a note with index {note_index}")
# Note cut using ^^ as note
if note_index == 169 or note_index == -1:
if samplenum > 0:
# This limitation is only for channel 4. It should never happen in a
# regular song.
raise("Note cut + Sample in same row: Not supported in channel 4")
samplenum = 0xFE
if note_index != 169 and note_index != -1 and samplenum > 0:
command[0] = HAS_KIT | (samplenum & 0xF)
command[1] = s3m_volume_to_gb(volume) & 0xF
command_len = 2
else:
if note_index == 169:
command[0] = HAS_DRUM_EFFECT | EFFECT_NOTE_CUT
command[1] = 1 # 0 ticks
command_len = 2
elif effectnum is not None:
[num, params] = effect_s3m_to_gb(4, effectnum, effectparams)
if num is not None:
command[0] = HAS_DRUM_EFFECT | (num & 0x0F)
command[1] = (params & 0xFF) | 1
command_len = 2
elif volume > -1:
#command[0] = HAS_VOLUME | (s3m_volume_to_gb(volume) & 0xF)
command[0] = 0
command_len = 1
return command[:command_len]
STARTUP_CMD_DONE = 0
STARTUP_CMD_SPEED = 1
STARTUP_CMD_PANING = 2
STARTUP_CMD_CHANNEL3_INSTRUMENT = 3
SAMPLE_64_ENTRIES = 1 << 7
def initial_state_array(speed, panning_array, instruments):
array = []
# Initial speed
# -------------
array.extend([STARTUP_CMD_SPEED, speed])
# Initial panning
# ---------------
array.extend([STARTUP_CMD_PANING])
array.extend(panning_array)
# Channel 3 instruments
# ---------------------
if instruments is not None:
print("Exporting instruments...")
count = 0
for inst in instruments:
# In the tracker, instruments start at index 1, but they start at
# index 0 in the S3M file.
count += 1
# Only handle instruments assigned to channel 3
if count < 8 or count > 15:
continue
name = inst.sample_name
size = inst.length
if size != 32 and size != 64:
raise S3MFormatError(f"Sample '{name}': Invalid sample length: {size}")
else:
flags = count - 8 # The low bits are the instrument index
if size == 64:
flags |= SAMPLE_64_ENTRIES
array.extend([STARTUP_CMD_CHANNEL3_INSTRUMENT, flags])
# Convert from 8 bit to 4 bit
for i in range(0, size, 2):
sample_hi = inst.sample_data[i + 0] >> 4
sample_lo = inst.sample_data[i + 1] >> 4
value = (sample_hi << 4) | sample_lo
array.extend([value])
# End commands
# ------------
array.extend([STARTUP_CMD_DONE])
return array
def convert_file(module_path, song_name, output_path, export_instruments):
with open(module_path, "rb") as file:
file_byte_array = bytearray(file.read())
s3m = S3MFile(file_byte_array)
if output_path == None:
output_path = song_name + ".inc"
with open(output_path, "w") as fileout:
fileout.write("; s3m2gbt modified by shoofle to output rgbds-compatible asm files\n")
# Export patterns
# ---------------
print(f"Exporting patterns...")
pattern = -1
for p in s3m.patterns:
pattern += 1
# Check if pattern is actually used in the order list. If it isn't
# used, don't export it.
if pattern not in s3m.song_orders:
print(f"Pattern {pattern} not exported: Not in the order list")
continue
fileout.write(f"SECTION \"{song_name}_{pattern}\", ROMX\n")
fileout.write(f"{song_name}_{pattern}:\n")
row = 0
cmd1 = [0]
cmd2 = [0]
cmd3 = [0]
cmd4 = [0]
for c in p.cells:
# If an end of row marker is reached, print the previous row.
# Trust that the S3M file is generated in a valid way and it
# doesn't have markers at weird positions, and that there is one
# marker right at the end of each pattern.
if c.empty:
# Write row
fileout.write(" db ")
cmd = cmd1 + cmd2 + cmd3 + cmd4
for b in cmd:
if b == -1: fileout.write(f"$FF, ")
else: fileout.write(f"${b:02X},")
fileout.write("\n")
row = row + 1
# Clear commands
cmd1 = [0]
cmd2 = [0]
cmd3 = [0]
cmd4 = [0]
# Next iteration
continue
volume = -1
if c.has_volume:
volume = c.volume
note = -1
instrument = 0
if c.has_note_and_instrument:
note = c.note - 0b0010_0001 # note indices should start from 0=C3
note = note + 1 # s3m note values go 00..0A, 0F, 10..1A, 1F, etc.
note = (note // 16) * 12 + (note % 16) #these expressions compensate for it.
note = note - 1
instrument = c.instrument
# Rows with note and instrument but no volume use the
# default volume of the sample.
if instrument > 0 and volume == -1:
this_instr = s3m.instruments[instrument - 1]
volume = this_instr.default_volume
effectnum = None
effectparams = None
if c.has_effect:
# Convert type to ASCII to match the documentation
effectnum = chr(c.effect + ord('A') - 1)
effectparams = c.effect_args
channel = c.channel + 1
try:
if channel == 1:
cmd1 = convert_channel(channel, note, instrument, volume, effectnum, effectparams)
elif channel == 2:
cmd2 = convert_channel(channel, note, instrument, volume, effectnum, effectparams)
elif channel == 3:
cmd3 = convert_channel(channel, note, instrument, volume, effectnum, effectparams)
elif channel == 4:
cmd4 = convert_channel(channel, note, instrument, volume, effectnum, effectparams)
else:
raise S3MFormatError(f"Too many channels: {channel}")
except RowConversionError as e:
e.row = row
e.pattern = pattern
e.channel = channel
raise e
fileout.write("\n")
fileout.write("\n")
# Export initial state
# --------------------
print(f"Exporting initial state...")
fileout.write(f"{song_name}_init_state:\n")
default_pan = [8, 8, 8, 8]
for i in range(0, 4):
default_pan[i] = s3m.channel_pan[i]
gb_default_pan = [
s3m_pan_to_gb(default_pan[0], 1),
s3m_pan_to_gb(default_pan[1], 2),
s3m_pan_to_gb(default_pan[2], 3),
s3m_pan_to_gb(default_pan[3], 4)
]
instr = None
if export_instruments:
instr = s3m.instruments
state_array = initial_state_array(s3m.initial_speed, gb_default_pan, instr)
# Write rows of 8 bytes until the end of the array
while True:
left = len(state_array)
write = []
if left == 0:
break
elif left <= 8:
write = state_array
state_array = []
else:
write = state_array[0:8]
state_array = state_array[8:]
fileout.write(" db ")
for s in write:
fileout.write(f"0x{s:02X},")
fileout.write("\n")
fileout.write("\n")
# Export orders
# -------------
print(f"Exporting orders...")
fileout.write(f"SECTION \"{song_name}\", ROMX\n")
fileout.write(f"{song_name}:\n")
#fileout.write(f" {song_name}_init_state,")
#fileout.write("\n")
for o in s3m.song_orders:
pattern = int(o)
if pattern >= s3m.num_patterns:
# TODO: Warn if the pattern goes over the limit?
continue
fileout.write(f" db BANK({song_name}_{pattern})\n")
fileout.write(f" dw {song_name}_{pattern}\n")
fileout.write("\n")
fileout.write(" db $00\n")
fileout.write(" dw $0000\n")
fileout.write("\n")
if __name__ == "__main__":
import argparse
import sys
print("s3m2gbt v4.4.1 (part of GBT Player)")
print("Copyright (c) 2022 Antonio Niño Díaz <antonio_nd@outlook.com>")
print("All rights reserved")
print("")
parser = argparse.ArgumentParser(description='Convert S3M files into GBT format.')
parser.add_argument("--input", default=None, required=True,
help="input file")
parser.add_argument("--name", default=None, required=True,
help="output song name")
parser.add_argument("--output", default=None, required=False,
help="output file")
parser.add_argument("--instruments", default=False, required=False,
action='store_true', help="export channel 3 instruments")
args = parser.parse_args()
try:
convert_file(args.input, args.name, args.output, args.instruments)
except RowConversionError as e:
print("ERROR: " + str(e))
sys.exit(1)
except S3MFormatError as e:
print("ERROR: Invalid S3M file: " + str(e))
sys.exit(1)
print("Done!")
sys.exit(0)