Skip to content

Commit

Permalink
whitespace cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lydon42 committed Sep 1, 2024
1 parent afa2374 commit 143c9a1
Show file tree
Hide file tree
Showing 21 changed files with 1,506 additions and 1,501 deletions.
46 changes: 23 additions & 23 deletions src/hyppo/audiomix.asm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
;; /* -------------------------------------------------------------------
;; MEGA65 "HYPPOBOOT" Combined boot and hypervisor ROM.
;; Paul Gardner-Stephen, 2014-2019.
;; Paul Gardner-Stephen, 2014-2024.
;; ---------------------------------------------------------------- */
audiomix_setup:

;; Set all audio mixer coefficients to silent by default
ldx #$00
txa
txa
aml1:
jsr audiomix_setcoefficient
inx
Expand All @@ -18,28 +18,28 @@ aml1:
jsr audiomix_set2coefficients
ldx #$de
jsr audiomix_set2coefficients
;; And also for speaker / HDMI audio outputs
;; Now we have a fun problem: Internal speakers need it MUCH louder than HDMI
;; and we wouldn't be able to set the two independently.
lda #$ff
;; And also for speaker / HDMI audio outputs
;; Now we have a fun problem: Internal speakers need it MUCH louder than HDMI
;; and we wouldn't be able to set the two independently.
lda #$ff
ldx #$1e
jsr audiomix_set2coefficients
ldx #$3e
jsr audiomix_set2coefficients

jsr audio_set_stereo

;; Set OPL / FM / SFX / Adlib volume to max on all channels
lda #$0c
;; Set OPL / FM / SFX / Adlib volume to max on all channels
lda #$0c
fmvolloop:
tax
lda #$ff
jsr audiomix_set2coefficients
txa
clc
adc #$20
bcc fmvolloop
tax
lda #$ff
jsr audiomix_set2coefficients
txa
clc
adc #$20
bcc fmvolloop


audio_set_mono:
;; Left and right SID volume levels
Expand Down Expand Up @@ -81,7 +81,7 @@ audiomix_set_sid_lr_coefficients:
ldx #$32
jmp audiomix_set2coefficients

audiomix_set_sid_rl_coefficients:
audiomix_set_sid_rl_coefficients:
ldx #$c2
jsr audiomix_set2coefficients
ldx #$d2
Expand All @@ -97,23 +97,23 @@ audiomix_set_sid_rl_coefficients:
ldx #$20
jsr audiomix_set2coefficients
ldx #$30
jmp audiomix_set2coefficients
jmp audiomix_set2coefficients

audio_set_stereo:
;; Left and right SID volume levels
;; for stereo operation
lda #$be
jsr audiomix_set_sid_lr_coefficients
jsr audiomix_set_sid_lr_coefficients
lda #$40
jmp audiomix_set_sid_rl_coefficients
jmp audiomix_set_sid_rl_coefficients

audio_set_stereomirrored:
;; Left and right SID volume levels
;; for stereo operation
lda #$40
jsr audiomix_set_sid_lr_coefficients
jsr audiomix_set_sid_lr_coefficients
lda #$be
jmp audiomix_set_sid_rl_coefficients
jmp audiomix_set_sid_rl_coefficients

audiomix_setcoefficient:
stx audiomix_addr
Expand Down
192 changes: 96 additions & 96 deletions src/hyppo/constants.asm
Original file line number Diff line number Diff line change
@@ -1,150 +1,150 @@
;; /* -------------------------------------------------------------------
;; MEGA65 "HYPPOBOOT" Combined boot and hypervisor ROM.
;; Paul Gardner-Stephen, 2014-2019.
;; Paul Gardner-Stephen, 2014-2024.
;; ---------------------------------------------------------------- */

os_version = $0102
dos_version = $0103
constant_partition_type_fat32_chs = $0b
constant_partition_type_fat32_lba = $0c
constant_partition_type_megea65_sys = $41
os_version = $0102
dos_version = $0103
constant_partition_type_fat32_chs = $0b
constant_partition_type_fat32_lba = $0c
constant_partition_type_megea65_sys = $41

;; DOS error codes
;;
dos_errorcode_partition_not_interesting = $01
dos_errorcode_bad_signature = $02
dos_errorcode_is_small_fat = $03
dos_errorcode_too_many_reserved_clusters = $04
dos_errorcode_not_two_fats = $05
dos_errorcode_too_few_clusters = $06
dos_errorcode_readwrite_timeout = $07
dos_errorcode_partition_error = $08
dos_errorcode_invalid_address = $10
dos_errorcode_illegal_value = $11
dos_errorcode_read_error = $20
dos_errorcode_write_error = $21
dos_errorcode_no_such_disk = $80
dos_errorcode_name_too_long = $81
dos_errorcode_not_implemented = $82
dos_errorcode_file_too_long = $83
dos_errorcode_too_many_open_files = $84
dos_errorcode_invalid_cluster = $85
dos_errorcode_is_a_directory = $86
dos_errorcode_not_a_directory = $87
dos_errorcode_file_not_found = $88
dos_errorcode_invalid_file_descriptor = $89
dos_errorcode_image_wrong_length = $8A
dos_errorcode_image_fragmented = $8B
dos_errorcode_no_space = $8C
dos_errorcode_file_exists = $8D
dos_errorcode_directory_full = $8E
dos_errorcode_double_attach = $8F
dos_errorcode_eof = $FF
dos_errorcode_partition_not_interesting = $01
dos_errorcode_bad_signature = $02
dos_errorcode_is_small_fat = $03
dos_errorcode_too_many_reserved_clusters = $04
dos_errorcode_not_two_fats = $05
dos_errorcode_too_few_clusters = $06
dos_errorcode_readwrite_timeout = $07
dos_errorcode_partition_error = $08
dos_errorcode_invalid_address = $10
dos_errorcode_illegal_value = $11
dos_errorcode_read_error = $20
dos_errorcode_write_error = $21
dos_errorcode_no_such_disk = $80
dos_errorcode_name_too_long = $81
dos_errorcode_not_implemented = $82
dos_errorcode_file_too_long = $83
dos_errorcode_too_many_open_files = $84
dos_errorcode_invalid_cluster = $85
dos_errorcode_is_a_directory = $86
dos_errorcode_not_a_directory = $87
dos_errorcode_file_not_found = $88
dos_errorcode_invalid_file_descriptor = $89
dos_errorcode_image_wrong_length = $8A
dos_errorcode_image_fragmented = $8B
dos_errorcode_no_space = $8C
dos_errorcode_file_exists = $8D
dos_errorcode_directory_full = $8E
dos_errorcode_double_attach = $8F
dos_errorcode_eof = $FF

;; FAT directory entry constants
;;
;; these seem to be offsets into the STANDARD FAT32 header (DO NOT CHANGE)
;;
fs_fat32_dirent_offset_attributes = 11
fs_fat32_dirent_offset_shortname = 0
fs_fat32_dirent_offset_create_tenthsofseconds = 13
fs_fat32_dirent_offset_create_time = 14
fs_fat32_dirent_offset_create_date = 16
fs_fat32_dirent_offset_access_date = 18
fs_fat32_dirent_offset_clusters_high = 20
fs_fat32_dirent_offset_modify_time = 22
fs_fat32_dirent_offset_modify_date = 24
fs_fat32_dirent_offset_clusters_low = 26
fs_fat32_dirent_offset_file_length = 28
fs_fat32_dirent_offset_attributes = 11
fs_fat32_dirent_offset_shortname = 0
fs_fat32_dirent_offset_create_tenthsofseconds = 13
fs_fat32_dirent_offset_create_time = 14
fs_fat32_dirent_offset_create_date = 16
fs_fat32_dirent_offset_access_date = 18
fs_fat32_dirent_offset_clusters_high = 20
fs_fat32_dirent_offset_modify_time = 22
fs_fat32_dirent_offset_modify_date = 24
fs_fat32_dirent_offset_clusters_low = 26
fs_fat32_dirent_offset_file_length = 28

;; VFAT long file name entry constants
;;
;; These are the offsets of the various fields in a directory entry, when
;; used to store a long-file-name fragment.
;;
fs_fat32_dirent_offset_lfn_part_number = 0
fs_fat32_dirent_offset_lfn_type = 12 ;; $0C
fs_fat32_dirent_offset_lfn_checksum = 13
fs_fat32_dirent_offset_lfn_part1_chars = 5
fs_fat32_dirent_offset_lfn_part1_start = 1
fs_fat32_dirent_offset_lfn_part2_chars = 6
fs_fat32_dirent_offset_lfn_part2_start = 14
fs_fat32_dirent_offset_lfn_part3_chars = 2
fs_fat32_dirent_offset_lfn_part3_start = 28

fs_fat32_attribute_isreadonly = $01
fs_fat32_attribute_ishidden = $02
fs_fat32_attribute_issystem = $04
fs_fat32_attribute_isvolumelabel = $08
fs_fat32_attribute_isdirectory = $10
fs_fat32_attribute_archiveset = $20
fs_fat32_dirent_offset_lfn_part_number = 0
fs_fat32_dirent_offset_lfn_type = 12 ;; $0C
fs_fat32_dirent_offset_lfn_checksum = 13
fs_fat32_dirent_offset_lfn_part1_chars = 5
fs_fat32_dirent_offset_lfn_part1_start = 1
fs_fat32_dirent_offset_lfn_part2_chars = 6
fs_fat32_dirent_offset_lfn_part2_start = 14
fs_fat32_dirent_offset_lfn_part3_chars = 2
fs_fat32_dirent_offset_lfn_part3_start = 28

fs_fat32_attribute_isreadonly = $01
fs_fat32_attribute_ishidden = $02
fs_fat32_attribute_issystem = $04
fs_fat32_attribute_isvolumelabel = $08
fs_fat32_attribute_isdirectory = $10
fs_fat32_attribute_archiveset = $20

;; Possible file modes
;;
dos_filemode_directoryaccess = $80
dos_filemode_end_of_directory = $81
dos_filemode_readonly = 0
dos_filemode_readwrite = 1
dos_filemode_directoryaccess = $80
dos_filemode_end_of_directory = $81
dos_filemode_readonly = 0
dos_filemode_readwrite = 1

;; 256-byte fixed size records for REL emulaton
;;
dos_filemode_relative = 2
dos_filemode_relative = 2

;; Each disk entry consists of;
;;
;; Offset $00 - starting sector (4 bytes)
fs_start_sector = $00
fs_start_sector = $00

;; Offset $04 - sector count (4 bytes)
fs_sector_count = $04
fs_sector_count = $04

;; Offset $08 - Filesystem type & media source ($0x = FAT32, $xF = SD card, others reserved for now)
fs_type_and_source = $08
fs_type_and_source = $08

;; Remaining bytes are filesystem dependent:
;; For FAT32:
;;
;; Offset $09 - length of fat (4 bytes) (FAT starts at fs_fat32_system_sectors)
fs_fat32_length_of_fat = $09
fs_fat32_length_of_fat = $09

;; Offset $0D - system sectors (2 bytes)
fs_fat32_system_sectors = $0D
fs_fat32_system_sectors = $0D

;; Offset $0F - reserved clusters (1 byte)
fs_fat32_reserved_clusters = $0F
fs_fat32_reserved_clusters = $0F

;; Offset $10 - root dir cluster (2 bytes)
fs_fat32_root_dir_cluster = $10
fs_fat32_root_dir_cluster = $10

;; Offset $12 - cluster count (4 bytes)
fs_fat32_cluster_count = $12
fs_fat32_cluster_count = $12

;; Offset $16 - sectors per cluster
fs_fat32_sectors_per_cluster = $16
fs_fat32_sectors_per_cluster = $16

;; Offset $17 - copies of FAT
fs_fat32_fat_copies = $17
fs_fat32_fat_copies = $17

;; Offset $18 - first sector of cluster zero (4 bytes)
fs_fat32_cluster0_sector = $18
fs_fat32_cluster0_sector = $18

;; Offset $1C - Four spare bytes.

freeze_prep_none = 0
freeze_prep_palette0 = 2
freeze_prep_palette1 = 4
freeze_prep_palette2 = 6
freeze_prep_palette3 = 8
freeze_prep_stash_sd_buffer_and_regs = 10
freeze_prep_thumbnail = 12
freeze_prep_viciv = 14
freeze_prep_hyperregs = 16

d81_image_max_namelen = 32
d81_image_flag_mounted = 1
d81_image_flag_write_en = 4

syspart_error_readerror = $01
syspart_error_badslotnum = $02
syspart_error_badmagic = $42
syspart_error_nosyspart = $ff
freeze_prep_none = 0
freeze_prep_palette0 = 2
freeze_prep_palette1 = 4
freeze_prep_palette2 = 6
freeze_prep_palette3 = 8
freeze_prep_stash_sd_buffer_and_regs = 10
freeze_prep_thumbnail = 12
freeze_prep_viciv = 14
freeze_prep_hyperregs = 16

d81_image_max_namelen = 32
d81_image_flag_mounted = 1
d81_image_flag_write_en = 4

syspart_error_readerror = $01
syspart_error_badslotnum = $02
syspart_error_badmagic = $42
syspart_error_nosyspart = $ff
2 changes: 1 addition & 1 deletion src/hyppo/debug.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; /* -------------------------------------------------------------------
;; MEGA65 "HYPPOBOOT" Combined boot and hypervisor ROM.
;; Paul Gardner-Stephen, 2014-2019.
;; Paul Gardner-Stephen, 2014-2024.

;; These routines are included in the hickup-build-process primarily
;; for debug purposes. It is anticipated that these routines will
Expand Down
2 changes: 1 addition & 1 deletion src/hyppo/debugtests.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; /* -------------------------------------------------------------------
;; MEGA65 "HYPPOBOOT" Combined boot and hypervisor ROM.
;; Paul Gardner-Stephen, 2014-2019.
;; Paul Gardner-Stephen, 2014-2024.

;; This file is included in hyppo.a65 in the reset_entry routine.
;; i.e., anything put here is executed before reset resumes.
Expand Down
Loading

0 comments on commit 143c9a1

Please sign in to comment.