diff --git a/GABE_Control_Registers_def.asm b/GABE_Control_Registers_def.asm index ee12399..0bd614b 100644 --- a/GABE_Control_Registers_def.asm +++ b/GABE_Control_Registers_def.asm @@ -5,10 +5,26 @@ GABE_MSTR_CTRL = $AFE880 GABE_CTRL_PWR_LED = $01 ; Controls the LED in the Front of the case (Next to the reset button) GABE_CTRL_SDC_LED = $02 ; Controls the LED in the Front of the Case (Next to SDCard) +GABE_CTRL_STS_LED0 = $04 ; Control Status LED0 (General Use) - C256 Foenix U Only +GABE_CTRL_STS_LED1 = $08 ; Control Status LED0 (General Use) - C256 Foenix U Only GABE_CTRL_BUZZER = $10 ; Controls the Buzzer GABE_CTRL_WRM_RST = $80 ; Warm Reset (needs to Setup other registers) -GABE_NOTUSED = $AFE881 ; Reserved for future use +GABE_LED_FLASH_CTRL = $AFE881 ; Flashing LED Control +GABE_LED0_FLASH_CTRL = $01 ; 0- Automatic Flash 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +GABE_LED1_FLASH_CTRL = $02 ; 0- Automatic Flash 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED1 to manually control) + +GABE_LD0_FLASH_FRQ0 = $10 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +GABE_LD0_FLASH_FRQ1 = $20 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +; 00 - 1Hz +; 01 - 2hz +; 10 - 4hz +; 11 - 5hz +GABE_LD1_FLASH_FRQ0 = $40 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +GABE_LD1_FLASH_FRQ1 = $80 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) + + + GABE_RST_AUTH0 = $AFE882 ; Must Contain the BYTE $AD for Reset to Activate GABE_RST_AUTH1 = $AFE883 ; Must Contain the BYTE $DE for Reset to Activate @@ -31,14 +47,30 @@ GABE_RNG_CTRL_DV = $02 ; After Setting the Seed Value, Toggle that Bit fo GABE_SYS_STAT = $AFE887 ; GABE_SYS_STAT_MID0 = $01 ; Machine ID -- LSB -GABE_SYS_STAT_MID1 = $02 ; Machine ID -- MSB -GABE_SYS_STAT_EXP = $08 ; if Zero, there is an Expansion Card Preset -GABE_SYS_STAT_CPUA = $40 ; Indicates the (8bit/16bit) Size of the Accumulator -GABE_SYS_STAT_CPUX = $80 ; Indicates the (8bit/16bit) Size of the Accumulator +GABE_SYS_STAT_MID1 = $02 ; Machine ID -- +GABE_SYS_STAT_MID2 = $04 ; Machine ID -- MSB +;Bit 2, Bit 1, Bit 0 +;$000: FMX +;$100: FMX (Future C5A) +;$001: U 2Meg +;$101: U+ 4Meg U+ +;$010: TBD (Reserved) +;$110: TBD (Reserved) +;$011: A2560 Dev +;$111: A2560 Keyboard +GABE_SYS_STAT_EXP = $10 ; if Zero, there is an Expansion Card Preset +GABE_SYS_STAT_CPUA = $40 ; Indicates the (8bit/16bit) Size of the Accumulator - Not Implemented +GABE_SYS_STAT_CPUX = $80 ; Indicates the (8bit/16bit) Size of the Accumulator - Not Implemented -; Machine ID +GABE_SUBVERSION_LO = $AFE88A +GABE_SUBVERSION_HI = $AFE88B +GABE_VERSION_LO = $AFE88C +GABE_VERSION_HI = $AFE88D +GABE_MODEL_LO = $AFE88E +GABE_MODEL_HI = $AFE88F +; OLD Machine ID Definition - Deprecated ; $00 = FMX - Development Platform ; $01 = C256 Foenix - Dev Platform ; $10 = C256 Foenix - User Version (65C816) -; $11 = TBD \ No newline at end of file +; $11 = TBD diff --git a/OPL2_Library.asm b/OPL2_Library.asm index 9169681..f654e42 100644 --- a/OPL2_Library.asm +++ b/OPL2_Library.asm @@ -58,7 +58,7 @@ OPL2_TONE_TESTING_L2 RTL -OPL2_INIT +OPL3_INIT .as setal ; Just Making sure all the necessary variables are cleared before doing anything diff --git a/README.md b/README.md index 0396f27..e2f19c4 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,26 @@ Go to https://sourceforge.net/projects/tass64/ to get it. I'm currently using version *64tass Turbo Assembler Macro V1.54.1900* The model I'm using is RAD Tracker https://www.3eality.com/productions/reality-adlib-tracker. -The C256 Tracker is only able to play version 1.1 RAD files. +The C256 Tracker is only able to play version _1.1_ RAD files. + +Special Keys: +: start playing the song from the beggining +: start playing from current position in pattern +<=>: next pattern +<->: previous pattern +<;>: slow down (this uses the BPM algorithm, not the Speed parameter) +<'>: speed up (this uses the BPM algorithm, not the Speed parameter) +: read SD Card for files. In the menu, use up-arrow/down-arrow to navigate. to select a file. +<[>: Previous Instrument +<]>: Next Instrument +: play notes high +: play nodes low Todo List: * Implementation of RAD version 2.0. * Creating and Editing files. * Some effects are still not implemented. * Writing to SD Card. - * Reading from FAT12 SD Cards. You will need the C256 Foenix IDE to code and debug: https://github.com/Trinity-11/FoenixIDE. diff --git a/Rad_Player.asm b/Rad_Player.asm index 7d12641..d097159 100644 --- a/Rad_Player.asm +++ b/Rad_Player.asm @@ -30,7 +30,7 @@ TuneInfo .dstruct SongData ; We are assuming that the RAD File is already Loaded Somewhere ; ************************************************************************************************ RAD_INIT_PLAYER - JSL OPL2_INIT ; Init OPL2 + JSL OPL3_INIT ; Init OPL3 JSR RAD_ALL_NOTES_OFF ; zero the pattern memory diff --git a/SDOS.asm b/SDOS.asm index 8da2482..2330edd 100644 --- a/SDOS.asm +++ b/SDOS.asm @@ -6,6 +6,12 @@ .include "GABE_Control_Registers_def.asm" .include "ch376s_inc.asm" +; pointers to data +SD_DATA = $0080 ; 3 bytes - used indirect addressing +SD_TMP_DATA = $0083 ; 3 bytes - used indirect addressing +SD_DATA_FAT_PAGE = $0086 ; 2 bytes - last FAT page that was loaded +SD_MULT_AREA = $0088 ; 4 bytes + ; File System Offsets SD_FIRST_SECTOR = $5F00 ; 4 bytes SD_FAT_OFFSET = $5F04 ; 4 bytes @@ -13,21 +19,18 @@ SD_ROOT_OFFSET = $5F08 ; 4 bytes SD_DATA_OFFSET = $5F0C ; 4 bytes SD_RESERVED_SECTORS = $5F10 ; 2 bytes -SD_SECTORS_PER_FAT = $5F12 ; 2 bytes -SD_BYTES_PER_SECTOR = $5F14 ; 2 bytes -SD_FAT_COUNT = $5F16 ; 2 bytes -SD_SECTORS = $5F18 ; 4 bytes -SD_ROOT_ENTRIES = $5F1C ; 2 bytes +SD_SECTORS_PER_FAT = $5F12 ; 4 bytes - changed to 4 to allow FAT32 partitons +SD_BYTES_PER_SECTOR = $5F16 ; 2 bytes +SD_FAT_COUNT = $5F18 ; 2 bytes +SD_SECTORS = $5F1A ; 4 bytes +SD_ROOT_ENTRIES = $5F1E ; 2 bytes SD_DIR_OFFSET = $5F20 ; 2 bytes - use this to read the root directory -SD_NEXT_CLUSTER = $5F22 ; 2 bytes - use this to point to the next file cluster in the FAT +SD_NEXT_CLUSTER_NU = $5F22 ; 2 bytes - use this to point to the next file cluster in the FAT SD_SECTORS_PER_CLUSTER = $5F24 ; 2 byte -SD_FAT16 = $5F26 ; 1 byte - write 1 for FAT16, 0 for FAT12 +SD_FAT16_32 = $5F26 ; 1 byte - write 2 for FAT32, 1 for FAT16, 0 for FAT12 CLUSTER_PTR = $5F27 ; 2 bytes LOG_CLUSTER_PTR = $5F29 ; 4 bytes -SD_DATA = $0080 ; 3 bytes - used indirect addressing -SD_TMP_DATA = $0083 ; 3 bytes - used indirect addressing -SD_DATA_FAT_PAGE = $0086 ; 2 bytes - last FAT page that was loaded -SD_MULT_AREA = $0088 ; 4 bytes +; store cluster data here SD_BLK_BEGIN = $6000 ; 512 bytes SD_BTSCT_BEGIN = $6200 ; 512 bytes SD_ROOT_BEGIN = $6400 ; 512 bytes @@ -73,7 +76,6 @@ ISDOS_INIT setal LDA #0 STA SD_ROOT_OFFSET - STA SD_NEXT_CLUSTER setas ; SD Card is not present @@ -134,7 +136,7 @@ CALC_OFFSET_BYTES ; Affects: ; None ;****************************************************************************** -ISDOS_READ_MBR_BOOT +ISDOS_READ_MBR_AND_BOOT_SECTOR .as LDA SDCARD_PRSNT_MNT ; this must be non-zero BNE RMBR_CARD_PRESENT @@ -190,7 +192,7 @@ ISDOS_READ_MBR_BOOT LDA #0 STA SD_DATA + 2 - ; read the FAT Boot Sector - this overwrites the MBR record + ; read the Boot Sector setas JSL ISDOS_READ_BLOCK @@ -240,7 +242,7 @@ ISDOS_READ_MBR_BOOT BCS SD_SMALL_SECTORS ; number of sectors is more than fat12 can handle setas LDA #0 - STA SD_FAT16 + STA SD_FAT16_32 setal BRA SD_FAT12 @@ -250,17 +252,34 @@ ISDOS_READ_MBR_BOOT STA SD_SECTORS LDA SD_BTSCT_BEGIN,X + $22 STA SD_SECTORS + 2 + LDA #$FFFF + STA SD_ROOT_ENTRIES SD_SMALL_SECTORS setas LDA #1 - STA SD_FAT16 + STA SD_FAT16_32 setal SD_FAT12 LDA SD_BTSCT_BEGIN,X + $E STA SD_RESERVED_SECTORS LDA SD_BTSCT_BEGIN,X + $16 + BEQ SD_FAT32_SECTORS ; if sectors per FAT is 0, then this is a FAT32 partition STA SD_SECTORS_PER_FAT - + LDA #0 + STA SD_SECTORS_PER_FAT + 2 + BRA SD_COMPUTE_OFFSETS + + SD_FAT32_SECTORS + setas + LDA #2 ; identify the FAT32 partition + STA SD_FAT16_32 + setal + LDA SD_BTSCT_BEGIN,X + $24 + STA SD_SECTORS_PER_FAT + LDA SD_BTSCT_BEGIN,X + $26 + STA SD_SECTORS_PER_FAT+2 + + SD_COMPUTE_OFFSETS JSR COMPUTE_FAT_ROOT_DATA_OFFSETS RMBR_DONE RTL @@ -719,7 +738,7 @@ ISDOS_PARSE_ROOT_DIR ; ***************************************************************************** ; * Load the FAT table -; * A must contain the sector to read +; * 'A' must contain the sector to read ; ***************************************************************************** ISDOS_READ_FAT_SECTOR .al @@ -769,8 +788,8 @@ ISDOS_READ_FAT_SECTOR ; ***************************************************************************** ; * Load Data Cluster -; * A must contain the cluster to read; -; * subsctract 2 and then multiplied by sectors by cluster. +; * 'A' must contain the cluster to read +; * substract 2 and then multiplied by sectors by cluster. ; ***************************************************************************** ISDOS_READ_DATA_CLUSTER .al @@ -783,10 +802,24 @@ ISDOS_READ_DATA_CLUSTER RTL SDR_CARD_PRESENT + ; if FAT32, then add 32 pages to the cluster + LDA SD_FAT16_32 + AND #3 + CMP #2 + BEQ SDR_FAT32 + PLA ; offset by 2 and multiply by sectors by cluster SEC SBC #2 + BRA SDR_FAT_ADJ_CONTINUE + + SDR_FAT32 + PLA + SEC + SBC #6 + + SDR_FAT_ADJ_CONTINUE STA UNSIGNED_MULT_A LDA SD_SECTORS_PER_CLUSTER STA UNSIGNED_MULT_B @@ -853,7 +886,7 @@ ISDOS_READ_DATA_CLUSTER ; ***************************************************************************** -; * A contains the cluster to start at. +; * 'A' contains the cluster to start at. ; * SD_DATA must contain the pointer to write file data to. ; ***************************************************************************** ISDOS_READ_FILE @@ -874,18 +907,19 @@ ISDOS_READ_FILE JSL ISDOS_READ_DATA_CLUSTER - LDA SD_FAT16 - AND #$1 + LDA SD_FAT16_32 + AND #$3 ASL TAX JSR (READ_FAT_TABLE,X) - ; the last command is a compare + ; the last command in the subroutine is a compare BNE SD_CLUSTER_LOOP RTL READ_FAT_TABLE .word <>FAT12_GET_NEXT_CLUSTER .word <>FAT16_GET_NEXT_CLUSTER + .word <>FAT32_GET_NEXT_CLUSTER ; ***************************************************************************** ; * Read the FAT12 to determine the next cluster to read. @@ -916,7 +950,7 @@ FAT12_GET_NEXT_CLUSTER CMP #$FFF RTS - .comment + .comment - what is this??? ; maintain the location of file pointer LDA SD_DATA STA SD_TMP_DATA @@ -939,14 +973,15 @@ FAT12_GET_NEXT_CLUSTER LDA #$FFF STA CLUSTER_PTR + RTS - .endc + .endc ; ***************************************************************************** ; * Read the FAT16 to determine the next cluster to read. ; ***************************************************************************** FAT16_GET_NEXT_CLUSTER - + .al ; read the FAT page to read LDA CLUSTER_PTR XBA @@ -954,7 +989,7 @@ FAT16_GET_NEXT_CLUSTER ; avoid reloading the page CMP SD_DATA_FAT_PAGE - BEQ SKIP_FAT_LOADING + BEQ SKIP_FAT16_LOADING PHA ; ************************************** @@ -982,7 +1017,7 @@ FAT16_GET_NEXT_CLUSTER STA SD_DATA + 2 ; *************************************** - SKIP_FAT_LOADING + SKIP_FAT16_LOADING ; now read the 16-bit value LDA CLUSTER_PTR AND #$FF @@ -990,8 +1025,64 @@ FAT16_GET_NEXT_CLUSTER TAY LDA FAT_DATA,Y STA CLUSTER_PTR - CMP #$FFFF + CMP #$FFFF ; the branch instruction occurs upon return + RTS + +; ***************************************************************************** +; * Read the FAT32 to determine the next cluster to read. +; * The Foenix machine allows maximum 2GB SD Cards - so only the first two byes\ +; * of the FAT table need to be read. But one still needs to increase the +; * CLUSTER_PTR by 4 instead of 2. +; ***************************************************************************** +FAT32_GET_NEXT_CLUSTER + .al + ; read the FAT page to read + LDA CLUSTER_PTR + XBA + AND #$FF + + ; avoid reloading the page + CMP SD_DATA_FAT_PAGE + BEQ SKIP_FAT32_LOADING + + PHA + ; ************************************** + ; maintain the location of file pointer + LDA SD_DATA + STA SD_TMP_DATA + LDA SD_DATA + 2 + STA SD_TMP_DATA + 2 + + ; TODO load the FAT table + ; TODO find the next sector + LDA #FAT_DATA + STA SD_DATA + LDA #0 + STA SD_DATA + 2 + + ; load the FAT page + PLA + STA SD_DATA_FAT_PAGE + JSL ISDOS_READ_FAT_SECTOR + + LDA SD_TMP_DATA + STA SD_DATA + LDA SD_TMP_DATA + 2 + STA SD_DATA + 2 + ; *************************************** + + SKIP_FAT32_LOADING + ; now read the 16-bit value + LDA CLUSTER_PTR + AND #$FF + ASL A ; multiply by 4 + ASL A + TAY + LDA FAT_DATA,Y ; check for end of file + STA CLUSTER_PTR + CMP #$FFFF ; the branch instruction occurs upon return RTS + ; ***************************************************************************** ; * Add MBR offset and Reserved Sectors @@ -1014,7 +1105,7 @@ COMPUTE_FAT_ROOT_DATA_OFFSETS LDA SD_FIRST_SECTOR + 2 STA ADDER_B + 2 - ; result is 32 bites + ; result is 32 bytes LDA ADDER_R STA SD_FAT_OFFSET LDA ADDER_R + 2 @@ -1025,6 +1116,7 @@ COMPUTE_FAT_ROOT_DATA_OFFSETS STA UNSIGNED_MULT_A LDA SD_SECTORS_PER_FAT STA UNSIGNED_MULT_B + LDA UNSIGNED_MULT_RESULT STA SD_MULT_AREA LDA UNSIGNED_MULT_RESULT + 2 diff --git a/base.asm b/base.asm new file mode 100644 index 0000000..97355b5 --- /dev/null +++ b/base.asm @@ -0,0 +1,44 @@ +* = HRESET + CLC + XCE ; go into native mode + SEI ; ignore interrupts + JML TRACKER + +* = HIRQ ; IRQ handler. +RHIRQ + setaxl + PHB + PHD + PHA + PHX + PHY + ; + ; todo: look up IRQ triggered and do stuff + ; + JSL IRQ_HANDLER + + PLY + PLX + PLA + PLD + PLB + RTI + +; Interrupt Vectors +* = VECTORS_BEGIN +JUMP_READY JML TRACKER ; Kernel READY routine. Rewrite this address to jump to a custom kernel. +RVECTOR_COP .addr HCOP ; FFE4 +RVECTOR_BRK .addr HBRK ; FFE6 +RVECTOR_ABORT .addr HABORT ; FFE8 +RVECTOR_NMI .addr HNMI ; FFEA + .word $0000 ; FFEC +RVECTOR_IRQ .addr HIRQ ; FFEE + +RRETURN JML TRACKER + +RVECTOR_ECOP .addr HCOP ; FFF4 +RVECTOR_EBRK .addr HBRK ; FFF6 +RVECTOR_EABORT .addr HABORT ; FFF8 +RVECTOR_ENMI .addr HNMI ; FFFA +RVECTOR_ERESET .addr HRESET ; FFFC +RVECTOR_EIRQ .addr HIRQ ; FFFE diff --git a/boot-info.asm b/boot-info.asm index e1d109c..f7bd1c3 100644 --- a/boot-info.asm +++ b/boot-info.asm @@ -14,7 +14,7 @@ partentryrec .struct .ends bootrec .struct - void .fill 446 ; 16 lines + void .fill 446 ; 16 lines ; offset $1BE partition1 .dstruct partentryrec partition2 .dstruct partentryrec partition3 .dstruct partentryrec @@ -32,27 +32,27 @@ bootsector .struct .ends biosparamblock .struct - .fill 2 ; bytes per second - should be 512 - .fill 1 ; sectors per cluster - .fill 2 ; reserved sectors - .fill 1 ; Number of FATs - should be 2 - .fill 2 ; Root Entries - .fill 2 ; small sectors - 0 with large sectors set. - .fill 1 ; media type - $F8 hard disk - .fill 2 ; sectors per FAT - .fill 2 ; sectors per track - .fill 2 ; number of heades - .fill 4 ; hidden sectors - .fill 4 ; large sectors + .fill 2 ; bytes per sector - should be 512 ; offset 0x0B + .fill 1 ; sectors per cluster ; offset 0x0D + .fill 2 ; reserved sectors ; offset 0x0E + .fill 1 ; Number of FATs - should be 2 ; offset 0x10 + .fill 2 ; Root Entries ; offset 0x11 + .fill 2 ; small sectors - 0 with large sectors set. ; offset 0x13 + .fill 1 ; media type - $F8 hard disk ; offset 0x15 + .fill 2 ; sectors per FAT ; offset 0x16 + .fill 2 ; sectors per track ; offset 0x18 + .fill 2 ; number of heads ; offset 0x1A + .fill 4 ; hidden sectors ; offset 0x1C + .fill 4 ; large sectors ; offset 0x20 .ends extendedbiosprm .struct - .fill 1 ; physical disk number - floppies start at $0, hard disks at $80 - .fill 1 ; current heades - .fill 1 ; signature $28 or $29 - .fill 4 ; volume serial number - .fill 11 ; volume label - .fill 8 ; system id - FAT12 or FAT16 depending on format + .fill 4 ; logical sectors per FAT ; offset 0x24 + .fill 2 ; drive description ; offset 0x28 + .fill 2 ; version ; offset 0x2A + .fill 4 ; cluster number of root directory start ; offset 0x2C + .fill 2 ; Logical sector number of FS Information Sector ; offset 0x30 + .fill 2 ; first logical sector number of a copy of the three FAT32 boot sectors ; offset 0x32 .ends \ No newline at end of file diff --git a/bpm-to-timer-count.xlsx b/bpm-to-timer-count.xlsx index 78f3a27..f278765 100644 Binary files a/bpm-to-timer-count.xlsx and b/bpm-to-timer-count.xlsx differ diff --git a/c256-track-screenshot.png b/c256-track-screenshot.png index f1872ca..c740e51 100644 Binary files a/c256-track-screenshot.png and b/c256-track-screenshot.png differ diff --git a/display.asm b/display.asm index bd7ddd1..837de43 100644 --- a/display.asm +++ b/display.asm @@ -1,7 +1,8 @@ ; each line is 80 characters SCREEN_WIDTH = 80 -TRACKER_SCREEN +MUSICAL_LINES_PER_BAR = 64 +TRACKER_SCREEN line1 .byte $D5 .fill SCREEN_WIDTH - 2, $C3 .byte $C9 @@ -16,7 +17,7 @@ line3 .byte $c2 .fill (SCREEN_WIDTH - 40) / 2, 0 .text 'C256 Foenix Tracker' ; 19 characters .fill 4, 0 - .text '[Version 0.3.1]' ; 15 characters + .text '[Version 0.4.0]' ; 15 characters .fill (SCREEN_WIDTH - 40) / 2, 0 .byte $c2 ;.fill UNUSED_SCR, 0 @@ -51,7 +52,7 @@ line6 .byte $c2 .byte $c2 .fill 1,0 .text 'MIDI' - .fill 14,0 + .fill SCREEN_WIDTH -66,0 .byte $c2 ;.fill UNUSED_SCR, 0 @@ -452,7 +453,7 @@ line24 .byte $c2 .fill 2, 0 .text 'File: ' ; 17 chars - .fill 17, 0 + .fill SCREEN_WIDTH - 63, 0 .byte $c2 ;.fill UNUSED_SCR, 0 @@ -467,7 +468,7 @@ line25 .byte $ca .byte $b1 .fill 8, $C3 .byte $c3 - .fill 27, $C3 + .fill SCREEN_WIDTH - 53, $C3 .byte $cb ;.fill UNUSED_SCR, 0 @@ -476,25 +477,25 @@ top_line .rept 8 ; 8 * 9 .byte $b2 .next .fill 8,$c3 - ;.fill UNUSED_SCR, 0 + .fill SCREEN_WIDTH - 80, 0 line27 .for col = '1', col <= '8', col += 1 .text ' - ',col,' - ' .byte $c2 .next .text ' - 9 - ' - ;.fill UNUSED_SCR-1, 0 + .fill SCREEN_WIDTH - 80, 0 btm_line .rept 8 .fill 8,$c3 .byte $b1 .next .fill 8,$c3 - ;.fill UNUSED_SCR-1, 0 + .fill SCREEN_WIDTH - 80, 0 blank_line .fill 80, $20 - ;.fill 48, 0 + .fill SCREEN_WIDTH - 80, 0 tick_line .rept 8 @@ -502,7 +503,7 @@ tick_line .byte $db .next .text '--- ----' - ;.fill UNUSED_SCR-1, 0 + .fill SCREEN_WIDTH - 80, 0 untick_line .rept 8 @@ -510,14 +511,14 @@ untick_line .byte $c2 .next .text '--- ----' - ;.fill UNUSED_SCR-1, 0 + .fill SCREEN_WIDTH - 80, 0 line60 .rept 8 .fill 8,$c3 .byte $b1 .next .fill 8,$c3 - ;.fill UNUSED_SCR-1, 0 + .fill SCREEN_WIDTH - 80, 0 FNXFONT .binary "Font/FOENIX-CHARACTER-ASCII-2.bin", 0, 2048 diff --git a/display_func.asm b/display_func.asm index 5402cb5..2a6bac7 100644 --- a/display_func.asm +++ b/display_func.asm @@ -2,17 +2,17 @@ ; * Initialize display ; * 80 columns by 60 rows DRAW_DISPLAY - ; set the display size - 128 x 64 - LDA #SCREEN_WIDTH - STA COLS_PER_LINE - LDA #64 - STA LINES_MAX + ; set the display size - 128 x 64 - RevB only + ;LDA #SCREEN_WIDTH + ;STA COLS_PER_LINE + ;LDA #64 + ;STA LINES_MAX - ; set the visible display size - 80 x 60 - LDA #80 - STA COLS_VISIBLE - LDA #60 - STA LINES_VISIBLE + ; set the visible display size - 80 x 60 - RevB only + ;LDA #80 + ;STA COLS_VISIBLE + ;LDA #60 + ;STA LINES_VISIBLE LDA #0 STA BORDER_X_SIZE STA BORDER_Y_SIZE @@ -25,10 +25,11 @@ DRAW_DISPLAY LDA #0 STA BORDER_COLOR_G - ; enable the border - LDA #Border_Ctrl_Enable + ; disable the border STA BORDER_CTRL_REG - + ; disable pixel doubling and hi-res + STA MASTER_CTRL_REG_H + ; enable text display LDA #Mstr_Ctrl_Text_Mode_En STA MASTER_CTRL_REG_L @@ -354,7 +355,7 @@ draw_tick_line next_line INC TAB_COUNTER LDA TAB_COUNTER - CMP #65 + CMP #MUSICAL_LINES_PER_BAR + 1 BEQ DRAW_BOTTOM_BAR LDA REM_LINES BNE TRIPLET diff --git a/file_load.asm b/file_load.asm index 674811a..6739d9a 100644 --- a/file_load.asm +++ b/file_load.asm @@ -44,7 +44,7 @@ LOAD_SDCARD_DATA BEQ LOAD_SDCARD_DATA_DONE ; if SD not present, exit ; show files from the SDRAM - JSL ISDOS_READ_MBR_BOOT + JSL ISDOS_READ_MBR_AND_BOOT_SECTOR ; read the root directory JSL ISDOS_PARSE_ROOT_DIR @@ -183,7 +183,7 @@ READ_FILE setas - JSL OPL2_INIT + JSL OPL3_INIT ; load the song JSL RAD_INIT_PLAYER diff --git a/interrupt_def.asm b/interrupt_def.asm index 7e5e1df..9acb548 100644 --- a/interrupt_def.asm +++ b/interrupt_def.asm @@ -8,7 +8,7 @@ INT_PENDING_REG3 = $000143 ; FMX Model INT_POL_REG0 = $000144 ; INT_POL_REG1 = $000145 ; INT_POL_REG2 = $000146 ; -INT_POL_REG7 = $000147 ; FMX Model +INT_POL_REG3 = $000147 ; FMX Model ; Edge Detection Enable INT_EDGE_REG0 = $000148 ; @@ -41,7 +41,7 @@ FNX1_INT03_COM2 = $08 ;Serial Port 2 FNX1_INT04_COM1 = $10 ;Serial Port 1 FNX1_INT05_MPU401 = $20 ;Midi Controller Interrupt FNX1_INT06_LPT = $40 ;Parallel Port -FNX1_INT07_SDCARD = $80 ;SD Card Controller Interrupt (CH376S) +FNX1_INT07_SDCARD = $80 ;SD Card Controller Interrupt (CH376S) ; Register Block 2 FNX2_INT00_OPL3 = $01 ;OPl3 diff --git a/macros_inc.asm b/macros_inc.asm index 2f05043..54127d3 100644 --- a/macros_inc.asm +++ b/macros_inc.asm @@ -59,8 +59,8 @@ setdbr .macro ; Set the B (Data bank) register .databank \1 PLP PLA ; end setdbr macro - .endm - + .endm + TURN_ON_SD_LED .macro ; turn on the LED LDA GABE_MSTR_CTRL @@ -74,4 +74,24 @@ TURN_OFF_SD_LED .macro LDA GABE_MSTR_CTRL AND #~GABE_CTRL_SDC_LED STA GABE_MSTR_CTRL - .endm \ No newline at end of file + .endm + +LOAD_KBD_STATUS_PORT .macro + LDA @lGABE_SYS_STAT + AND #$7 + BNE LKSP_U + LDA @lSTATUS_PORT_FMX + BRA + + LKSP_U + LDA @lSTATUS_PORT_U + + .endm + +LOAD_KBD_INPT_BUF .macro + LDA @lGABE_SYS_STAT + AND #$7 + BNE LKIB_U + LDA @lKBD_INPT_BUF_FMX + BRA + + LKIB_U + LDA @lKBD_INPT_BUF_U + + .endm \ No newline at end of file diff --git a/release-notes.txt b/release-notes.txt index 27e28ad..937c02d 100644 --- a/release-notes.txt +++ b/release-notes.txt @@ -1,7 +1,12 @@ +Version 0.4.0 +------------- +Vicky II version +Added FAT32 support for SD Cards. + Version 0.3.0 ------------- -Added FAT16 support for SD Card. -Added RAD File Version: v1 or v2. +Added FAT16 support for SD Cards. +Added RAD File Version display: v1 or v2. Added Slow Timer indicator: * in front of the speed value. Version 0.2.0 diff --git a/sdcard.asm b/sdcard.asm deleted file mode 100644 index 49849c1..0000000 --- a/sdcard.asm +++ /dev/null @@ -1,356 +0,0 @@ -.cpu "65816" -.include "macros_inc.asm" -.include "bank_00_inc.asm" -.include "io_def.asm" -.include "interrupt_def.asm" -.include "math_def.asm" -.include "vicky_def.asm" -.include "kernel_inc.asm" - -LINE_COUNTER = $B0 - -* = HRESET - CLC - XCE ; go into native mode - SEI ; ignore interrupts - JML SDCARD - -* = HIRQ ; IRQ handler. -RHIRQ setaxl - PHB - PHD - PHA - PHX - PHY - ; - ; todo: look up IRQ triggered and do stuff - ; - JSL IRQ_HANDLER - - PLY - PLX - PLA - PLD - PLB - RTI - -; Interrupt Vectors -* = VECTORS_BEGIN -JUMP_READY JML SDCARD ; Kernel READY routine. Rewrite this address to jump to a custom kernel. -RVECTOR_COP .addr HCOP ; FFE4 -RVECTOR_BRK .addr HBRK ; FFE6 -RVECTOR_ABORT .addr HABORT ; FFE8 -RVECTOR_NMI .addr HNMI ; FFEA - .word $0000 ; FFEC -RVECTOR_IRQ .addr HIRQ ; FFEE - -RRETURN JML SDCARD - -RVECTOR_ECOP .addr HCOP ; FFF4 -RVECTOR_EBRK .addr HBRK ; FFF6 -RVECTOR_EABORT .addr HABORT ; FFF8 -RVECTOR_ENMI .addr HNMI ; FFFA -RVECTOR_ERESET .addr HRESET ; FFFC -RVECTOR_EIRQ .addr HIRQ ; FFFE - -; ***************************************************************************** -; ***************************************************************************** -; *** SDCARD READER *** -; ***************************************************************************** -; ***************************************************************************** -* = $5000 - -SDCARD - setas - setxl - JSL CLEAR_DISPLAY - - LDX #<>sd_card_tester - JSR DISPLAY_MSG - ; initialize the SD Card - JSL ISDOS_INIT - JSL ISDOS_READ_MBR_BOOT - ; read the root sectors - JSL ISDOS_DISPLAY_ROOT_DIR - - ; These are temporary sub-routines to help me debug - ; READ the First FAT Sectors - setal - LDA #$6600 ; store the block at SD_DATA - STA SD_DATA - LDA #0 - JSL ISDOS_READ_FAT_SECTOR - - LDA #$6800 ; store the block at SD_DATA - STA SD_DATA - LDA #1 - JSL ISDOS_READ_FAT_SECTOR - - LDA #$6A00 ; store the block at SD_DATA - STA SD_DATA - LDA #4 - JSL ISDOS_READ_FILE - - LDA #$6A00 ; read file may change SD_DATA pointer - STA SD_DATA - setas - JSR DISPLAY_BLOCK - - SDCARD_DONE - BRL SDCARD_DONE - - - - -CLEAR_DISPLAY - .as - .xl - setal - LDA #SCREEN_WIDTH - STA COLS_PER_LINE - LDA #64 - STA LINES_MAX - - ; set the visible display size - 80 x 60 - LDA #80 - STA COLS_VISIBLE - LDA #60 - STA LINES_VISIBLE - setas - LDA #16 - STA BORDER_X_SIZE - STA BORDER_Y_SIZE - - ; set the border to purple - LDA #$80 - STA BORDER_COLOR_R - LDA #0 - STA BORDER_COLOR_B - STA BORDER_COLOR_G - - ; set the text color to 2 - LDA #$20 - STA CURCOLOR - - ; reset the position of the cursor to 0,0 - LDX #0 - LDY #0 - JSL LOCATE - - ; enable the border - LDA #Border_Ctrl_Enable - STA BORDER_CTRL_REG - - ; enable text display - LDA #Mstr_Ctrl_Text_Mode_En - STA MASTER_CTRL_REG_L - - setal - LDA #$60FF - STA FG_CHAR_LUT_PTR + 8; - STA BG_CHAR_LUT_PTR + 8; - LDA #$0080 - STA FG_CHAR_LUT_PTR + 10; - STA BG_CHAR_LUT_PTR + 10; - - LDA #<>CS_TEXT_MEM_PTR ; store the initial screen buffer location - STA SCREENBEGIN - STA CURSORPOS - setas - LDA #`CS_TEXT_MEM_PTR - STA SCREENBEGIN+2 - STA CURSORPOS+2 - - - setdbr $af - LDX #0 - LDY #0 - LDA #$20 - CD_CLEAR_LOOP - STA #$A000,b,X - STA #$C000,b,X - INX - CPX #$2000 - BNE CD_CLEAR_LOOP - setdbr $0 - - RTL - -.include "SDOS.asm" - -; ***************************************************************************** -; * Output text to screen - temporary until SDOS is finished -; * X contains the address of the message in the bank -; ***************************************************************************** -DISPLAY_MSG - .as - .xl - LDA #`sd_card_tester - PHB - PHA - PLB - JSL PUTS - PLB - RTS - - -; ***************************************************************************** -; * Display a block of data at SD_BLK_BEGIN (512 bytes) -; ***************************************************************************** -BLANK = 0 -DISPLAY_BLOCK - .as - .xl - PHB - LDA #$AF - PHA - PLB - - LDA #32 ; 32 x 16 is 512 bytes - STA LINE_COUNTER - - LDX SD_DATA - LDY CURSORPOS - DB_LINE_LOOP - LDA #0 - XBA - DB_LOOP - LDA 0, X - JSR DISPLAY_HEX - - ; display a blank - LDA #BLANK - STA #0,b,Y - INY - - INX - TXA - AND #$F - CMP #8 - BNE SKIP_COL - - ; every 8th column display an extra blank - LDA #BLANK - STA #0,b,Y - INY - SKIP_COL - TXA - AND #$F - BNE DB_LOOP - - setal - TYA - AND #$FF80 - CLC - ADC #$80 - TAY - setas - DEC LINE_COUNTER - BNE DB_LINE_LOOP - - PLB - RTL - -; ***************************************************************************** -; * Only display the 4 MBR Partition Records -; ***************************************************************************** -DISPLAY_PARTITION_RECS - .as - .xl - PHB - LDA #$AF - PHA - PLB - - LDA #5 ; display signature and 4 partition lines - STA LINE_COUNTER - - LDX #0 - DPR_LINE_LOOP - LDA #0 - XBA - DPR_LOOP - ; the partition tables start at byte 466 - LDA @lSD_BLK_BEGIN+430,X - JSR DISPLAY_HEX - - ; display a blank - LDA #BLANK - STA #0,b,Y - INY - - INX - TXA - AND #$F - CMP #8 - BNE DPR_SKIP_COL - - ; every 8th column display an extra blank - LDA #BLANK - STA #0,b,Y - INY - DPR_SKIP_COL - TXA - AND #$F - BNE DPR_LOOP - - setal - TYA - AND #$FF80 - CLC - ADC #$80 - TAY - setas - DEC LINE_COUNTER - BNE DPR_LINE_LOOP - - PLB - RTL - -; ***************************************************************************** -; * Display a Hex value -; * Accumulator A contains the value to display -; * Bank must be $AF -; * Y is the screen offset -; ***************************************************************************** -HEX_VALUES .text '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' -DISPLAY_HEX - .as - .xl - setal - PHX - - PHA - AND #$F0 - LSR - LSR - LSR - LSR - AND #$F - - ; display the first character in hex - tax - LDA @lHEX_VALUES,X - STA #0,b,Y - INY - - ; display the second character in hex - PLA - AND #$F - tax - LDA @lHEX_VALUES,X - STA #0,b,Y - INY - - PLX - setas - - RTS - -; ***************************************************************************** -; * Handle interrupts -; ***************************************************************************** -IRQ_HANDLER - .as - .xl - RTL \ No newline at end of file diff --git a/tracker.asm b/tracker.asm index 4d90e0d..0a83d25 100644 --- a/tracker.asm +++ b/tracker.asm @@ -33,49 +33,7 @@ CHAR_COPY = $81 ORDER_EDITOR_SCR = SCREEN_WIDTH * 7 + 53 PTRN_EDITOR_SCR = SCREEN_WIDTH * 27 + 4 -* = HRESET - CLC - XCE ; go into native mode - SEI ; ignore interrupts - JML TRACKER - -* = HIRQ ; IRQ handler. -RHIRQ setaxl - PHB - PHD - PHA - PHX - PHY - ; - ; todo: look up IRQ triggered and do stuff - ; - JSL IRQ_HANDLER - - PLY - PLX - PLA - PLD - PLB - RTI - -; Interrupt Vectors -* = VECTORS_BEGIN -JUMP_READY JML TRACKER ; Kernel READY routine. Rewrite this address to jump to a custom kernel. -RVECTOR_COP .addr HCOP ; FFE4 -RVECTOR_BRK .addr HBRK ; FFE6 -RVECTOR_ABORT .addr HABORT ; FFE8 -RVECTOR_NMI .addr HNMI ; FFEA - .word $0000 ; FFEC -RVECTOR_IRQ .addr HIRQ ; FFEE - -RRETURN JML TRACKER - -RVECTOR_ECOP .addr HCOP ; FFF4 -RVECTOR_EBRK .addr HBRK ; FFF6 -RVECTOR_EABORT .addr HABORT ; FFF8 -RVECTOR_ENMI .addr HNMI ; FFFA -RVECTOR_ERESET .addr HRESET ; FFFC -RVECTOR_EIRQ .addr HIRQ ; FFFE +.include "base.asm" * = $381000 @@ -138,9 +96,8 @@ TRACKER JSL IOPL2_TONE_TEST JSR ENABLE_IRQS - JSL OPL2_INIT - - CLI + JSL OPL3_INIT + JSR INIT_TIMER0 ; TIMER0 is setup for 50hz ; we allow input of data via MIDI JSR INIT_MIDI @@ -148,6 +105,8 @@ TRACKER JSR DISPLAY_ORDERS JSR DISPLAY_PATTERN + CLI + ALWAYS NOP NOP diff --git a/tracker.hex b/tracker.hex index fffc029..e26bf76 100644 --- a/tracker.hex +++ b/tracker.hex @@ -1,9 +1,9 @@ :1700600000000000000000000000170001010101000000000000006E :020000040038C2 :1A0F000000000000003031323334353637383941424344454600007D0101B6 -:07FF000018FB785CD36338A5 +:07FF000018FB785C3B64383C :11FF6000C2308B0B48DA5A22A451387AFA682BAB404B -:20FFE0005CD3633810FF20FF30FF40FF000060FF5CD3633810FF20FF30FF40FF00FF60FF78 +:20FFE0005C3B643810FF20FF30FF40FF000060FF5C3B643810FF20FF30FF40FF00FF60FFA6 :201000006B0181019801B001CA01E50102022002410263028702AE0200010208090A1011A1 :20102000120304050B0C0D131415101314121511100804020120406080E0C000244FF20B54 :20104000000E3100520B004143434F52444E2020200031436E17010222058B0C0242414714 @@ -352,7 +352,7 @@ :203BE0000000000000000000000000000000000000000000000000000000000000000000C5 :203C000000000000000000000000000000000000000000000000000000000000000000C2E2 :203C2000C200000000000000000000000000000000000000004332353620466F656E697859 -:203C400020547261636B6572000000005B56657273696F6E20302E332E315D0000000000CA +:203C400020547261636B6572000000005B56657273696F6E20302E342E305D0000000000CA :203C6000000000000000000000000000000000C2C2000000000000000000000000000000C0 :203C8000000000000000000000000000000000000000000000000000000000000000000024 :203CA00000000000000000000000000000000000000000000000000000000000000000C242 @@ -528,244 +528,248 @@ :2051E0008D4001202B55E220AD4101F04BAD41012901C901D0068D4101204252AD410129C1 :2052000008C908D0068D410120AA55AD41012910C910D0068D410120AB55AD41012920C92A :2052200020D0068D4101200D55AD41012940C940D0068D410120AC55E220AD4201F000C25C -:20524000306BA20000AF6010AF8D880FC210A0460020B157C901D00FAF150F38C902D007E9 -:2052600022476A384CE953C91AD008C66A204E654CE953C91BD008E66A204E654CE953C925 -:205280000CD01FAF150F38290FD014AF180F38C901F00CF838E9018F180F38D82061584C13 +:20524000306BA20000AF6010AF8D880FC210A0460020A357C901D00FAF150F38C902D007F7 +:2052600022B26A384CE953C91AD008C66A20B9654CE953C91BD008E66A20B9654CE953C9E4 +:205280000CD01FAF150F38290FD014AF180F38C901F00CF838E9018F180F38D82053584C21 :2052A000E953C90DD01FAF150F38290FD014AF180F38C930F00CF81869018F180F38D82063 -:2052C00061584CE953C927D00BAF170F38C904F0F13A800DC928D016AF170F38C9F0F0E2D1 -:2052E0001A8F170F3820C95A20C1644CE953C929D01CA900EBAF150F384829304A4AAA68D3 -:205300005FCD5A388F150F3820D65A4CE953C92AD003822C01C9AAD003823001C91DD003E5 +:2052C00053584CE953C927D00BAF170F38C904F0F13A800DC928D016AF170F38C9F0F0E2DF +:2052E0001A8F170F3820BB5A202C654CE953C929D01CA900EBAF150F384829304A4AAA6875 +:205300005FBF5A388F150F3820C85A4CE953C92AD003822C01C9AAD003823001C91DD00301 :20532000823401C99DD003823801C938D003823C01C9B8D003824001C948D01848AF150F04 -:2053400038290FD00320EC54C902D004226B5C38684CE953C950D01848AF150F38290FD09E -:205360000320A154C902D00422525C38684CE9532980C980D00AA900853220C636820001B3 +:2053400038290FD00320EC54C902D004225D5C38684CE953C950D01848AF150F38290FD0AC +:205360000320A154C902D00422445C38684CE9532980C980D00AA900853220C636820001C1 :20538000AD880FE210AAAD870F2910C910F026AD870F2920C920F024AD870F2940C940F094 -:2053A00035C210AD880F207168E210AE880FBF003938823400BF803938822D00BF003A38FC -:2053C000F027C902D00EAF150F38290FC902F004223A69388013BF803A38F00D290F20BBBA -:2053E00068C210206D5BE21060C210A04A0020B157C90DD01F48AF150F38F01BC902F0393E -:20540000AF4C010009048F4C0100A9008F150F3820976C684C8054AD870FD0062079642032 -:205420006158A9018F150F3820B56CAF4C010029FB8F4C0100684C805468220F6A384C8052 +:2053A00035C210AD880F20DC68E210AE880FBF003938823400BF803938822D00BF003A3891 +:2053C000F027C902D00EAF150F38290FC902F00422A569388013BF803A38F00D290F2026E4 +:2053E00069C210205F5BE21060C210A04A0020A357C90DD01F48AF150F38F01BC902F03959 +:20540000AF4C010009048F4C0100A9008F150F3820026D684C8054AD870FD00620E464205B +:205420005358A9018F150F3820206DAF4C010029FB8F4C0100684C805468227A6A384C8089 :2054400054AD870F09108D870F4C8054AD870F29EF8D870F4C8054AD870F09208D870F4CE0 :205460008054AD870F29DF8D870F4C8054AD870F09408D870F4C8054AD870F29BF8D870FAD -:20548000AF6410AF2901C901D0034C455260AF150F382901F045AF160F381ACF696A38D0F6 +:20548000AF6410AF2901C901D0034C455260AF150F382901F045AF160F381ACFD46A38D08B :2054A0003CA56C8903D00CAF80E8AF29FD09028F80E8AF18F8E66CAF190F386901C965D0C1 -:2054C00007A901646C209A64D88F190F38206158AF150F382901F00320B56CA9008F160FC7 +:2054C00007A901646C200565D88F190F38205358AF150F382901F00320206DA9008F160FFD :2054E00038AF80E8AF29FD8F80E8AF6038F8C66CAF190F38E901D006A93F856CA964D88F04 -:20550000190F38206158A9008F160F386048C210AF3113AF85612980C980F00DAF3013AF2B +:20550000190F38205358A9008F160F386048C210AF3113AF85612980C980F00DAF3013AF39 :2055200020D955A561C980D0E76860AF6010AF48A20000E210A6E0D00629078F000F3868DB :205540009F0607AFE8E003D02CAF0207AF85E1AF0307AF85E2AF0407AF85E3AF0507AF85CD -:20556000E418AF000F38C210A03C0020B157E210207A55A20086E0C21060E220AF000F3850 +:20556000E418AF000F38C210A03C0020A357E210207A55A20086E0C21060E220AF000F385E :20558000F026C22018AF0207AF4A4A4A851A8F1400AF18AF0407AF4A4A4A851C8F1600AF71 :2055A000E220A9038F1000AF60606060606B48E22064606466A9058F3011AFA93F8F3113E4 -:2055C000AFA06603AF3013AF20B157C8C8AF3113AF2980C980D0ED6860C2104810164829F0 -:2055E0000F85636829704A4A4A8562C90ED01120C256800C48E210A562AA68FC2869C210C0 -:205600006860A66095648A1A8560C902D0716460A9008527C210A562A0020420B157A56465 -:205620008F120100A0040420B157A9008F1101008F130100A90C8F10010038AF140100E9D1 -:20564000028531A0080420B157AF1601008530A00A0420B157A565A00C0420B157C900D0F2 -:205660000F8532A9FFA00E0420B15720C636800FA9018532C22020F53722013238E220E237 -:205680001060A66095648A1A8560C902D01CC210A562A0A20420B157A564A0A40420B1579B -:2056A000A565A0A60420B15764606048C210A562A0F20420B15768A0F40420B157A9108505 -:2056C0006260C210AF6600001AC903D002A900A0420520B1578F6600006060A9508511A9C4 -:2056E000408515A950850FA93C8513A9008F0800AF8F0900AFE220A9208F0500AF8F0700EC -:20570000AFA9008F0600AFA9018F0400AFA9018F0000AFC220A900A0850C8517E220A9AF67 -:20572000850E8519C230A9BF08A2803BA000A054AF38A90008A28045A0008054AF38A9FFE3 -:20574000608F481FAF8F881FAFA980008F4A1FAF8F8A1FAFA920808F4C1FAF8F8C1FAFA924 -:2057600010008F4E1FAF8F8E1FAFA9CCCC8F501FAF8F901FAFA9CC008F521FAF8F921FAF95 -:20578000A922DD8F541FAF8F941FAFA9DD008F561FAF8F961FAFA20014E220A9209FFFBFB5 -:2057A000AFCAD0F9A0E00B20795A20D65A206D5B6048DA5A8F010F3829F04A4A4A4AE2100B -:2057C000AABF050F388F030F38AF010F38290FAABF050F388F040F38C2307AAF030F389781 -:2057E0000CA93030BB9F00C0AFE220FA6860DAC900F025A94F970CA930BB9F00C0AFC8A9A1 -:205800006E970CA930BB9F00C0AFC8A920970CA930BB9F00C0AF8023A94F970CA930BB9F8E -:2058200000C0AFC8A966970CA930BB9F00C0AFC8A966970CA930BB9F00C0AFFA60A90A8F25 -:20584000010F38A767970CE667D002E668A930BB9F00C0AFC8AF010F383A8F010F38D0E3BD -:20586000608B0BA9398572AF180F38A0430720B1573A8F0001009C0101C220A901078F02AD -:205880000100AF0401001A8570E220AF190F38A0370720B157A920856EA0C0A8A56CC90A85 -:2058A000B02F38A909E56CF015856DC220A94F00A2404454AF38E220C66EC66DD0EDC22094 -:2058C000A94F00A2504354AF38E220C66EA901800538A56CE909856DA90048ABA91C8F00DE -:2058E00001009C01019C0301A56D3A8F020100C220AF0401008573E220A56D2903F015C2F6 -:2059000020A94F00A2E04454AF38E220209359C66E4C2659C220A94F00A2904454AF38E2F4 -:2059200020209359C66EE66DA56DC941F006A56ED0A6F022C220A94F00A2F04354AF38E23B -:2059400020A56EF011C220A94F00A2404454AF38E220C66ED0EF2BAB60A00000A26307B74A -:20596000515A9B970CE87AC8C00800D008A92E5A9B970CE87AC00B00D0E59BC8C8A9769742 -:205980000CC8AF676A388902D004A9318002A932970C605ADAA90985F7C2209838E950A0F5 -:2059A000AAE220A473C8644EB770E8C8C900D004E8E8800320555A2A900BA9315A9B970CDD -:2059C0007AA910854EE8B770C820E259C900D004E8E88005B77020345AC8E8C6F7D0C7FACA -:2059E0007A605A489BA20000EBA900EB29F0D009A54ED003C8800EA9004A4A4A4AAABF0522 -:205A00000F38970CC868290FF007AABF050F38970CC8BB7A605A489B29F04A4A4A4AAABFA1 -:205A2000050F38970CC868290FAABF050F38970CC8BB7A60482907856F6829F8184A4A4A6F -:205A40008576F8F00918A9006908C676D0FA656F20155AD8605A48489BC220290F00AAE25C -:205A600020BF5A6A38970CC86829704A4A4A4A186930970CC8BB687A608BA9AF48ABA90916 -:205A8000856DA9429900C0C89900C0C89900C0C8A9529900C0C89900C0C8A9429900C0C87D -:205AA0009900C0C89900C0C8C8C66DD0D5AB605AAF696A38A0580720B157AF6A6A38F0070C -:205AC000A92AA05707970C7A6060402020102040203020204020A900EBAF150F3829304AF6 -:205AE0004A4848AABFCA5A38A20A00A09621970CC8CAD0FAA0E421970C68AABFCB5A38A2ED -:205B00000500A0C521970CC8CAD0FA68AABFCC5A38A20900A02128970CC8C8C8C8C8970C0A -:205B2000C8C8C8C8CAD0F0206D5B60AF686A38F03BC90E9002A90E856DA20000A06502C212 -:205B400020A924FC85F0A9390085F2E2208A20B157C8C8C85A9BB7F01A7A20B157E8C22060 -:205B60009818694D00A8E220C66DD0E160A20900A06B28BFB16838F006A940970C8004A934 -:205B800020970C888888888888888888CAD0E4605AA41A970CC8841A7A6BC220A51A29E0EC -:205BA000FF18696F00851AE2206B8B4808E220A90048AB2868BD0000F00722905B38E88080 -:205BC000F4AB605AA00B00B751C910D023A9E022905B38A00000B75122905B38C8C00800A2 -:205BE000D0F4A92022905B38C8C01100D0F48033A92022905B38A00000B75122905B38C800 -:205C0000C00800D0F4A92E22905B38B75122905B38C8C00B00D0F4A92022905B38C8C01092 -:205C200000D0F47A6B48C230A900C08517AD1F038D0001A950008D0201AD040118698F03D1 -:205C4000A8E220A9AF8519A21200689717C8CAD0FA6B18AD1F031AC926B00FA95022255CC8 -:205C600038EE1F03A90522255C386B18AD1F033A30F8A95022255C38CE1F03A90522255C8A -:205C8000386BAF80E8AF29FD09028F80E8AFC220A900008D085F8D225FE220853FA9018F38 -:205CA00002EAAFA9018F03EAAFAF04EAAF2901C901F0F6AF05EAAFF008A2916220AA5B80CF -:205CC00006A901853F8000AF80E8AF29FD8F80E8AF6BA58A0A858B18A5880A85899002E6B5 -:205CE0008BE2206488C22060A53FD0016BC220A900608580A900008582A900008F07EAAF51 -:205D00008F09EAAFE22022D25D38AF05EAAFF0016BC220ADFE61C955AAF0016BC220A2BECA -:205D200001BD08608588BD0A60858A20D25CA5888D005F8F07EAAFA58A8D025F8F09EAAF16 -:205D4000A900628580A900008582E22022D25D38AF05EAAFF0016BC220A20000BD0B628D14 -:205D6000145FE220BD0D628D245FA9008D255FC220BD106229FF008D165FBD11628D1C5F45 -:205D8000BD1362F0288D185FA900008D1A5FAD185F8D1201AD245F8D1001AD1401C9F70FE3 -:205DA000B017E220A9008D265FC2208015BD20628D185FBD22628D1A5FE220A9018D265FA0 -:205DC000C220BD0E628D105FBD16628D125F20C1616B5AAF80E8AF29FD09028F80E8AFA53C -:205DE0003FD002802DA9028F02EAAFA9018F03EAAFAF04EAAF2901C901F0F6AF05EAAFF0D8 -:205E000002800FA00000AF10EAAF9780C8C00002D0F4A9018F14EAAFAF80E8AF29FD8F80B3 -:205E2000E8AF7A6B48A00000B78022181000C8C00800F007C00B00D0EF800E68488918D0BD -:205E4000E7A92E2218100080DF688918D03BA9388B48ABA2C063221C1000ABA01B00B780B8 -:205E600022801000A01A00B78022801000A9388B48ABA2CB63221C1000ABA01F00B780228D -:205E800080100088C01B00D0F4A90D2218100060A53FD0016BC220A900008D205FA9006427 -:205EA0008580A900008582AD205F0AEB8D2001A900008D2201AD085F8D2401AD0A5F8D2676 -:205EC00001AD28018F07EAAFAD2A018F09EAAFE22022D25D38AF05EAAFF008A2316320AAE3 -:205EE0005B806AA780D0045C4D5F38C9E5F035A00B00B780C90FD0045C785F388902F002D9 -:205F000080228908F0045C635F388910F0045C4E5F3848A9388B48ABA2B263221C1000ABDF -:205F20006820245EC220A58029E001C9E001D00FAD205F1ACD1C5FB0148D205F4C9D5EA573 -:205F400080186920008580E2205CE35E386B48A9388B48ABA2A463221C1000AB6820245E86 -:205F60004C245F48A9388B48ABA28863221C1000AB6820245E4C245F4C245FA00B00C910F9 -:205F8000F002A9019751A00000A20B00B7809751C8CAD0F8C220A01A00B780A0100097514C -:205FA000A01C00B780A00C009751A01E00B780A00E009751A551186912008551E22060A569 -:205FC0003FD0016BC220A900008D205FA900648580A900008582AD205F0AEB8D2001A90075 -:205FE000008D2201AD085F8D2401AD0A5F8D2601AD28018F07EAAFAD2A018F09EAAFE22051 -:2060000022D25D38AF05EAAFF0045C6A6038A780D0045C6A6038C9E5F027A00B00B780C98F -:206020000FD0045C4160388902F00280148908F0045C4160388910F005207B5F8003207BD7 -:206040005FC220A58029E001C9E001D00FAD205F1ACD1C5FB0148D205F4CCC5FA5801869CC -:2060600020008580E2205C0E60386B48A53F29FF00D002686B688588A90000858A20D25C18 -:20608000A5888D2001A58A8D2201AD045F8D2401AD065F8D2601AD28018F07EAAFAD2A01E1 -:2060A0008F09EAAFE22022D25D38AF05EAAFF008A2126320AA5B8000C2206B48A53F29FF82 -:2060C00000D002686B6838E902008D0001AD245F8D0201AD040148A200008588A90000856B -:2060E0008A20D25CA5888D2001A58A8D2201AD0C5F8D2401AD0E5F8D2601AD28018F07EA20 -:20610000AFAD2A018F09EAAFE22022D25D38AF05EAAFF00AA9FF8D275F8D285F8017C220AD -:20612000A5801869000285809002E682681A48E8EC245FD0A5C220686B48A53F29FF00D049 -:2061400002686B688D275F22BB6038AD265F2901000AAAFC5961D0EF6B5D618261AD275FB6 -:206160004A900E186D275FA8B900664A4A4A4A800A6D275FA8B9006629FF0F8D275FC9FFE7 -:206180000F60AD275FEB29FF00C586F02248A5808583A5828585A900668580A90000858283 -:2061A000688586226B6038A5838580A5858582AD275F29FF000AA8B900668D275FC9FFFFE3 -:2061C00060AD105F8588A90000858A20D25CA5888D2001A58A8D2201AD005F8D2401AD0209 -:2061E0005F8D2601AD28018D045FAD2A018D065FAD165F8D0001AD125F8D0201AD04018567 -:2062000088AD0601858A20D25CA5888D2001A58A8D2201AD045F8D2401AD065F8D2601ADF6 -:2062200028018D085FAD2A018D0A5FAD085F8D2001AD0A5F8D2201A920008588A9000085E7 -:206240008A20D25CA5888D2401A58A8D2601AD28018D0C5FAD2A018D0E5F603030202D20D7 -:2062600057656C636F6D6520746F2074686520534443617264205465737465720D003031B8 -:20628000202D20436172642050726573656E740D003031202D204E4F2053444341524420AD -:2062A00050524553454E540D003032202D2043616E27742072656164204D4252202D204EBC -:2062C0006F20436172642070726573656E740D003033202D204572726F7220647572696E6B -:2062E000672072656164206F7065726174696F6E0D003034202D204572726F72207265614A -:2063000064696E6720426F6F7420736563746F720D003035202D204572726F722072656136 -:2063200064696E672046415420736563746F720D003035202D204572726F7220726561646B -:20634000696E6720526F6F7420736563746F720D003035202D204572726F722072656164E6 -:20636000696E67204461746120736563746F720D00496E76616C6964204D4252205369677D -:206380006E61747572650D00566F6C756D65204E616D653A200056464154204E616D6520FC -:2063A000203A20004469726563746F727920203A200046696C656E616D652020203A200039 -:2063C0002C20436C75737465723A002C2053697A653A00A9FF8F4801008F4901008F4A0101 -:2063E00000A9FF8F4C01008F4D01008F4E010020DB56202C6720C367203764207964A93877 -:206400008569A9428F6A0000A20000A900EBDABF181038AA204E65FAE8E00900D0ED2279DB -:20642000303820586422B130385820AE55202B5B206158EAEA80FC48A9E98F1200AFA900C0 -:206440008F1000AFC230A900008F1400AFA900008F1600AFE2206860AF40010029848F40CE -:206460000100AF41010029A18F410100A97B8F4C0100A95E8F4D010060A9008F150F388532 -:2064800048646C6449A9018F190F38A648BF24FC391A8F180F3820AF5A6048A900EBAF4834 -:2064A00000001ACF686A38D002A9008F480000AAA0900120B157BF24FC391A8F180F38680C -:2064C000608BA90048ABA9038D00019C01019C030138AF170F38E9048D0201C220AD040167 -:2064E000AAE220A9008D61018D62018D6301BF00003A8D6501BF01003A8D6601BF02003AA2 -:206500008D6701A9018D6401A90B8D6001AB608BA90048ABE220A9008D61018D62018D639C -:2065200001A9018D6401A90B8D6001AB60A9808F04E6AF204765A9108F02E6AF8F03E6AFEE -:20654000A9038F04E6AF60A23002CAD0FD60AF6A00008F000100A9008F0101008F030100C6 -:20656000A9168F020100C220AF04010018693B108567E220AF6A0000A0A30120B157A767E7 -:20658000D04BE667D002E66820CE65E667D002E668203E66E667D002E668207866E667D067 -:2065A00002E66820B466E667D002E668DAA62720F066FAE667D002E668200C67C220A567DF -:2065C0006906008567E220A0A801203D5860A767484848489F20E7AF2980A03D0220EE5790 -:2065E000682940A08D0220EE57682920A0DD0220EE57682910A02D0320EE5768290FA07E0D -:206600000320B157A00600B767484848489F23E7AF2980A0570220EE57682940A0A70220D2 -:20662000EE57682920A0F70220EE57682910A0470320EE5768290FA0980320B15760A76705 -:20664000489F40E7AF29C02A2A2AA0CE0320B15768293FA01E0420B157A00600B767489F18 -:2066600043E7AF29C02A2A2AA0E80320B15768293FA0380420B15760A767489F60E7AF29DF -:20668000F04A4A4A4AA06E0420B15768290FA0BE0420B157A00600B767489F63E7AF29F0C1 -:2066A0004A4A4A4AA0880420B15768290FA0D80420B15760A767489F80E7AF29F04A4A4AB8 -:2066C0004AA00E0520B15768290FA05E0520B157A00600B767489F83E7AF29F04A4A4A4AC5 -:2066E000A0280520B15768290FA0780520B15760A7674809F09FC0E7AF290E4AA06806206D -:20670000B157682901A0B80620B15760A7679FE0E7AF2907A0AE0520B157A00500B7679FC9 -:20672000E3E7AF2907A0C80520B157600B48DA0818E220A9008D870F20DA67A9AA8F6410E9 -:20674000AF20E567AF6010AFC955F003826F00A9AB8F6410AF20E567AF6010AFC900F00352 -:20676000825B00A9608F6410AF20DA67A9698F6010AF20DA67A9FF8F6010AFA2FFFFCAEA55 -:20678000EAEAEAEAEAEAEAE00000D0F220E567AF6010AF20DA67A9F48F6010AF20E567AFF0 -:2067A0006010AFC9FAD0EC20F067AF40010029808F400100AF41010029018F41010028FA4D -:2067C000682B60C230A2804DA90001A0000554AF38E220A9018F0007AF60AF6410AF29028D -:2067E000C902F0F660AF6410AF2901C901D0F66020DA67A9A88F6410AF20DA67A9A98F6492 -:2068000010AF20E567AF6010AFC900D0EC20DA67A9208F6410AF20E567AF6010AF09024891 -:2068200020DA67A9608F6410AF20DA67688F6010AFA9F6205668206968A9E820566820695F -:2068400068A900205668206968A9F4205668206968A90085E0604820DA67A9D48F6410AFA6 -:2068600020DA67688F6010AF6020E567AF6010AF6048DAE210AA3035BFC86838C210A09655 -:206880000020B1578F300000302329704A4A4A4A8F310000AF300000290F8F300000A900BE -:2068A0008F27000020F53722013238E220C210FA6860010101010101010101AACABFB2685D -:2068C0003849019FB268386080808031338036383A804180808080802C32343537393B3CEA -:2068E0004280808080808021238026282A808080808080801C22242527292B808080808018 -:20690000808080808080808080808080808080808080808080808080808080808080808077 -:2069200080808080808080800256025682568256AB56AB568256C256DA56C210A9028F15B4 -:206940000F3822825C38A9008D1F03A934855364526451205F69208A6920D069E2106BA9E6 -:2069600000A00004975188D0FBA53FF01C22E85C3822BF5F38C220A900668580A90000850E -:20698000828586226B6038E22060C230A900A0850CA900C08517E220A9AF850E8519A03EA9 -:2069A00003A9288580A28F03861AA20000A9148581BF804E38970CA9509717C8E8C681D0EF -:2069C000F0C2209818693C00A8E220C680D0DE6064516452A9348553A20000A00B00B7511D -:2069E000F02422C35B38C220A51A18693E00851AA5516912008551C98004B00AE8E02600D0 -:206A0000F004E22080D5E220A90522255C3860A900EBAD1F03C2308D0001A912008D020112 -:206A2000AD04018551A900808580A937008582A01000B75122396138E22022B13038226B43 -:206A40006A3822476A386B20796420DB56205959206158202B5B20AF5A6B439044914546B8 -:206A6000924793419442430000060022B1303820976CA20000A9009F000039E8D0F9C23026 -:206A8000A900808508A93700850AE220A01000B708C910D00522F76A386BC921D00422A309 -:206AA0006A386BA9028F676A3820B06A20826B6BA01100B7088940F017A9018F6A6A38A9A6 -:206AC0000F8D6501A9018D6601A90C8D670180238920F00AC8C220B708E220C88015A900B5 -:206AE0008F6A6A38A9988D6501A95E8D6601A9048D6701200F6560A9018F676A3820156B54 -:206B000020956B20BA6B20B06A6B0701080209030A04050B06C8B708291F8F696A38B70801 -:206B20002980F007C8B708C900D0F9C8A93885F2E220B708F04AC2203A8F000100A9160016 -:206B40008F020100AF04010018693B1085F0A90000E220C8644E87F0A64EBF0A6B38AAB751 -:206B6000085A9B97F07AC8E64EA54EC90B90E95AA00C00A92097F0C8C01600D0F87A80B075 -:206B8000C860B708C8C900D0F9A93885F2E220B708F000C860B7088F686A38AAC8C220A92E -:206BA00024FC85F0A9390085F2E220B708C887F0E6F0B002E6F1CAD0F26064F3A93985F6E8 -:206BC000C220B708F01F5AA8A5F329FF008F000100A901078F020100AF0401001A85F4E247 -:206BE0002020F26B7AC8C8E220E6F3A5F3C920D0CF60B7088F420000C8C220297F008F0022 -:206C00000100A91C008F020100AF0401001A8FFA0000E220A6FAB708C88FF90000290F8F4D -:206C2000F70000C2208A1865F765F765F7AAE220B7085A9B97F47AC8E8B7085A9B97F47AF7 -:206C4000C8E8290FF009B7085A9B97F47AC8E8AFF9000010BFAF4200001097605ADAA21293 -:206C600000A00000A92D970CC8CAD0FAFA7A605AA5F620B157C8C8A5F520B157C8C8A5F433 -:206C800020B1577A604848E2206820B15788886820B157C22068605AC220A900E7852CA960 -:206CA000AF00852EE220A0A000A900972CC8C0B900D0F87A605A205C6CC220AF180F382986 -:206CC000FF003A8F000100A901078F020100AF0401001A85F4E220A93985F6A0A000206F33 -:206CE0006CC220A56C297F008F000100A91C008F020100AF0401001AA0520020856CA8A984 -:206D00000000E22064288F270000AABFB26838D005C8C8C88058B7F4297F20D56EB7F429E5 -:206D2000804A4A4A854EC8B7F429F04A4A4A4A654EF0143A8F6A00005AA627A900EBBF18F2 -:206D40001038AA204E657AAF300000F011C90FF02BC2205A20F537220132387AE220A900E7 -:206D6000EBB7F4C8290FF0050AAAFC8D6DC8A900EBAF2700001AC909D08C7A60AF270000B4 -:206D80001869B0852CA900872CC8C880E1AD6D206E206EAD6DAD6DAD6DAD6DAD6DAD6DAD45 -:206DA0006DAE6DAD6D966E056EAD6D166E605AB7F4854CC220A900E7852CA9AF00852EE2D6 -:206DC00030A527AABF181038186940A8B72C48293F18654CC9409002A93F293F854E6829DA -:206DE000C0054E972CC8C8C8B72C48293F18654CC9409002A93F293F854E6829C0054E9710 -:206E00002CC2107A60B7F43A856CA9008F190F38209A647A7A60B7F48F696A3820AF5A60EC -:206E20005A4A8550B7F4854CC220A900E7852CA9AF00852EE230A5271869A0A8B72CC210D3 -:206E4000BBA05A0020B1579BE2104898186910A8B72C854EC210BBA0A80020B1572903A030 -:206E6000580020B1579BEB68AAA5508902F00AC2208A38E54CE2208008C2208A18654CE20A -:206E800020E210EB2903054E972C9838E910A8EB972CC2107A605AC220A900E7852CA9AF13 -:206EA00000852EE220B7F4297FF0013A493F854EE210A627BF181038186940A8B72C29C031 -:206EC00018654E972CC8C8C8B72C29C018654E972CC2107A605A4848AF2700000AA868F0FC -:206EE0000320B15729704A4A4A4A8F31000068290F8F3000007A605AE220A9018526C2201A -:206F0000A93800850AA53229FF003A0A0A0A0A18693B108508C220A9200022F53738E22014 -:206F2000A00000B708872CC220A9400022F53738E220A00200B708872CC220A9600022F5D6 -:206F40003738E220A00400B708872CC220A9800022F53738E220A00600B708872CC220A974 -:206F6000E00022F53738E220A00900B708290F872CA9008526C220A9200022F53738E220CF -:206F8000A00100B708872CC220A9400022F53738E220A00300B708872CC220A9600022F574 -:206FA0003738E220A00500B708872CC220A9800022F53738E220A07100B708872CC220A9A8 -:206FC000E00022F53738E220A00900B70829F04A4A4A4A872CA52718290F69C0852AA90050 -:1C6FE000852BC23018A900E7652A852CA9AF00852EE220A00800B708872C7A600A +:2055C000AFA06603AF3013AF20A357C8C8AF3113AF2980C980D0ED6860C2104810164829FE +:2055E0000F85636829704A4A4A8562C90ED01120C256800C48E210A562AA68FC9369C21055 +:205600006860A66095648A1A8560C902D0716460A9008527C210A562A0020420A357A56473 +:205620008F120100A0040420A357A9008F1101008F130100A90C8F10010038AF140100E9DF +:20564000028531A0080420A357AF1601008530A00A0420A357A565A00C0420A357C900D01C +:205660000F8532A9FFA00E0420A35720C636800FA9018532C22020F53722013238E220E245 +:205680001060A66095648A1A8560C902D01CC210A562A0A20420A357A564A0A40420A357B7 +:2056A000A565A0A60420A35764606048C210A562A0F20420A35768A0F40420A357A910852F +:2056C0006260C210AF6600001AC903D002A900A0420520A3578F6600006060A9008F0800CA +:2056E000AF8F0900AFE220A9208F0500AF8F0700AFA9008F0600AF8F0400AF8F0100AFA94A +:20570000018F0000AFC220A900A0850C8517E220A9AF850E8519C230A9BF08A2803BA00008 +:20572000A054AF38A90008A28045A0008054AF38A9FF608F481FAF8F881FAFA980008F4A87 +:205740001FAF8F8A1FAFA920808F4C1FAF8F8C1FAFA910008F4E1FAF8F8E1FAFA9CCCC8F9A +:20576000501FAF8F901FAFA9CC008F521FAF8F921FAFA922DD8F541FAF8F941FAFA9DD003B +:205780008F561FAF8F961FAFA20014E220A9209FFFBFAFCAD0F9A0E00B206B5A20C85A2071 +:2057A0005F5B6048DA5A8F010F3829F04A4A4A4AE210AABF050F388F030F38AF010F38299B +:2057C0000FAABF050F388F040F38C2307AAF030F38970CA93030BB9F00C0AFE220FA68608D +:2057E000DAC900F025A94F970CA930BB9F00C0AFC8A96E970CA930BB9F00C0AFC8A9209768 +:205800000CA930BB9F00C0AF8023A94F970CA930BB9F00C0AFC8A966970CA930BB9F00C08D +:20582000AFC8A966970CA930BB9F00C0AFFA60A90A8F010F38A767970CE667D002E668A9F2 +:2058400030BB9F00C0AFC8AF010F383A8F010F38D0E3608B0BA9398572AF180F38A0430705 +:2058600020A3573A8F0001009C0101C220A901078F020100AF0401001A8570E220AF190FE5 +:2058800038A0370720A357A920856EA0C0A8A56CC90AB02F38A909E56CF015856DC220A994 +:2058A0004F00A2404454AF38E220C66EC66DD0EDC220A94F00A2504354AF38E220C66EA9E9 +:2058C00001800538A56CE909856DA90048ABA91C8F0001009C01019C0301A56D3A8F020108 +:2058E00000C220AF0401008573E220A56D2903F015C220A94F00A2E04454AF38E220208553 +:2059000059C66E4C1859C220A94F00A2904454AF38E220208559C66EE66DA56DC941F00619 +:20592000A56ED0A6F022C220A94F00A2F04354AF38E220A56EF011C220A94F00A240445478 +:20594000AF38E220C66ED0EF2BAB60A00000A26307B7515A9B970CE87AC8C00800D008A976 +:205960002E5A9B970CE87AC00B00D0E59BC8C8A976970CC8AFD26A388902D004A9318002EC +:20598000A932970C605ADAA90985F7C2209838E950A0AAE220A473C8644EB770E8C8C9005F +:2059A000D004E8E8800320475A2A900BA9315A9B970C7AA910854EE8B770C820D459C900D5 +:2059C000D004E8E88005B77020265AC8E8C6F7D0C7FA7A605A489BA20000EBA900EB29F088 +:2059E000D009A54ED003C8800EA9004A4A4A4AAABF050F38970CC868290FF007AABF050FAD +:205A000038970CC8BB7A605A489B29F04A4A4A4AAABF050F38970CC868290FAABF050F385B +:205A2000970CC8BB7A60482907856F6829F8184A4A4A8576F8F00918A9006908C676D0FA57 +:205A4000656F20075AD8605A48489BC220290F00AAE220BFC56A38970CC86829704A4A4AFE +:205A60004A186930970CC8BB687A608BA9AF48ABA909856DA9429900C0C89900C0C8990083 +:205A8000C0C8A9529900C0C89900C0C8A9429900C0C89900C0C89900C0C8C8C66DD0D5ABA8 +:205AA000605AAFD46A38A0580720A357AFD56A38F007A92AA05707970C7A60604020201093 +:205AC0002040203020204020A900EBAF150F3829304A4A4848AABFBC5A38A20A00A09621A0 +:205AE000970CC8CAD0FAA0E421970C68AABFBD5A38A20500A0C521970CC8CAD0FA68AABF42 +:205B0000BE5A38A20900A02128970CC8C8C8C8C8970CC8C8C8C8CAD0F0205F5B60AFD36AA3 +:205B200038F03BC90E9002A90E856DA20000A06502C220A924FC85F0A9390085F2E2208A42 +:205B400020A357C8C8C85A9BB7F01A7A20A357E8C2209818694D00A8E220C66DD0E160A2C9 +:205B60000900A06B28BF1C6938F006A940970C8004A920970C888888888888888888CAD099 +:205B8000E4605AA41A970CC8841A7A6BC220A51A29E0FF18696F00851AE2206B8B4808E259 +:205BA00020A90048AB2868BD0000F00722825B38E880F4AB605AA00B00B751C910D023A9C5 +:205BC000E022825B38A00000B75122825B38C8C00800D0F4A92022825B38C8C01100D0F41E +:205BE0008033A92022825B38A00000B75122825B38C8C00800D0F4A92E22825B38B7512287 +:205C0000825B38C8C00B00D0F4A92022825B38C8C01000D0F47A6B48C230A900C08517ADEB +:205C20001F038D0001A950008D0201AD040118698F03A8E220A9AF8519A21200689717C834 +:205C4000CAD0FA6B18AD1F031AC926B00FA95022175C38EE1F03A90522175C386B18AD1FF6 +:205C6000033A30F8A95022175C38CE1F03A90522175C386BAF80E8AF29FD09028F80E8AF86 +:205C8000C220A900008D085FE220853FA9018F02EAAFA9018F03EAAFAF04EAAF2901C901D6 +:205CA000F0F6AF05EAAFF008A2F962209C5B8006A901853F8000AF80E8AF29FD8F80E8AF9F +:205CC0006BA58A0A858B18A5880A85899002E68BE2206488C22060A53FD0016BC220A900D5 +:205CE000608580A900008582A900008F07EAAF8F09EAAFE22022E65D38AF05EAAFF0016B3E +:205D0000C220ADFE61C955AAF0016BC220A2BE01BD08608588BD0A60858A20C15CA5888DCF +:205D2000005F8F07EAAFA58A8D025F8F09EAAFA900628580A900008582E22022E65D38AF79 +:205D400005EAAFF0016BC220A20000BD0B628D165FE220BD0D628D245FA9008D255FC220BF +:205D6000BD106229FF008D185FBD11628D1E5FBD1362F0288D1A5FA900008D1C5FAD1A5F67 +:205D80008D1201AD245F8D1001AD1401C9F70FB01DE220A9008D265FC220801BBD20628D31 +:205DA0001A5FBD22628D1C5FA9FFFF8D1E5FE220A9018D265FC220BD0E628D105FBD166272 +:205DC000F00B8D125FA900008D145F8015E220A9028D265FC220BD24628D125FBD26628DD8 +:205DE000145F2029626B5AAF80E8AF29FD09028F80E8AFA53FD002802DA9028F02EAAFA942 +:205E0000018F03EAAFAF04EAAF2901C901F0F6AF05EAAFF002800FA00000AF10EAAF978053 +:205E2000C8C00002D0F4A9018F14EAAFAF80E8AF29FD8F80E8AF7A6B48A00000B78022185E +:205E40001000C8C00800F007C00B00D0EF800E68488918D0E7A92E2218100080DF68891802 +:205E6000D03BA9388B48ABA22864221C1000ABA01B00B78022801000A01A00B7802280104A +:205E800000A9388B48ABA23364221C1000ABA01F00B7802280100088C01B00D0F4A90D22CA +:205EA00018100060A53FD0016BC220A900008D205FA900648580A900008582AD205F0AEBC0 +:205EC0008D2001A900008D2201AD085F8D2401AD0A5F8D2601AD28018F07EAAFAD2A018FBF +:205EE00009EAAFE22022E65D38AF05EAAFF008A29963209C5B806AA780D0045C615F38C965 +:205F0000E5F035A00B00B780C90FD0045C8C5F388902F00280228908F0045C775F388910C3 +:205F2000F0045C625F3848A9388B48ABA21A64221C1000AB6820385EC220A58029E001C960 +:205F4000E001D00FAD205F1ACD1E5FB0148D205F4CB15EA580186920008580E2205CF75E48 +:205F6000386B48A9388B48ABA20C64221C1000AB6820385E4C385F48A9388B48ABA2F0632F +:205F8000221C1000AB6820385E4C385F4C385FA00B00C910F002A9019751A00000A20B00CF +:205FA000B7809751C8CAD0F8C220A01A00B780A010009751A01C00B780A00C009751A01EB8 +:205FC00000B780A00E009751A551186912008551E22060A53FD0016BC220A900008D205F7C +:205FE000A900648580A900008582AD205F0AEB8D2001A900008D2201AD085F8D2401AD0A3A +:206000005F8D2601AD28018F07EAAFAD2A018F09EAAFE22022E65D38AF05EAAFF0045C7EA5 +:206020006038A780D0045C7E6038C9E5F027A00B00B780C90FD0045C5560388902F00280C2 +:20604000148908F0045C5560388910F005208F5F8003208F5FC220A58029E001C9E001D0A6 +:206060000FAD205F1ACD1E5FB0148D205F4CE05FA580186920008580E2205C2260386B4890 +:20608000A53F29FF00D002686B688588A90000858A20C15CA5888D2001A58A8D2201AD047A +:2060A0005F8D2401AD065F8D2601AD28018F07EAAFAD2A018F09EAAFE22022E65D38AF05A8 +:2060C000EAAFF008A27A63209C5B8000C2206B48A53F29FF00D002686BAD265F290300C9AC +:2060E0000200F0076838E9020080056838E906008D0001AD245F8D0201AD040148A200001E +:206100008588A90000858A20C15CA5888D2001A58A8D2201AD0C5F8D2401AD0E5F8D26012B +:20612000AD28018F07EAAFAD2A018F09EAAFE22022E65D38AF05EAAFF00AA9FF8D275F8D23 +:20614000285F8017C220A5801869000285809002E682681A48E8EC245FD0A5C220686B4805 +:20616000A53F29FF00D002686B688D275F22CF6038AD265F2903000AAAFC7F61D0EF6B85CD +:2061800061AA61E961AD275F4A900E186D275FA8B900664A4A4A4A800A6D275FA8B90066F0 +:2061A00029FF0F8D275FC9FF0F60AD275FEB29FF00C586F02248A5808583A5828585A9006C +:2061C000668580A900008582688586227F6038A5838580A5858582AD275F29FF000AA8B9D4 +:2061E00000668D275FC9FFFF60AD275FEB29FF00C586F02248A5808583A5828585A90066A7 +:206200008580A900008582688586227F6038A5838580A5858582AD275F29FF000A0AA8B9EF +:2062200000668D275FC9FFFF60AD105F8588A90000858A20C15CA5888D2001A58A8D2201E6 +:20624000AD005F8D2401AD025F8D2601AD28018D045FAD2A018D065FAD185F8D0001AD12BD +:206260005F8D0201AD04018588AD0601858A20C15CA5888D2001A58A8D2201AD045F8D24F5 +:2062800001AD065F8D2601AD28018D085FAD2A018D0A5FAD085F8D2001AD0A5F8D2201A96E +:2062A00020008588A90000858A20C15CA5888D2401A58A8D2601AD28018D0C5FAD2A018DC7 +:2062C0000E5F603030202D2057656C636F6D6520746F2074686520534443617264205465EA +:2062E000737465720D003031202D20436172642050726573656E740D003031202D204E4F12 +:20630000205344434152442050524553454E540D003032202D2043616E2774207265616426 +:20632000204D4252202D204E6F20436172642070726573656E740D003033202D2045727271 +:206340006F7220647572696E672072656164206F7065726174696F6E0D003034202D2045E3 +:2063600072726F722072656164696E6720426F6F7420736563746F720D003035202D2045D6 +:2063800072726F722072656164696E672046415420736563746F720D003035202D204572FD +:2063A000726F722072656164696E6720526F6F7420736563746F720D003035202D20457286 +:2063C000726F722072656164696E67204461746120736563746F720D00496E76616C696452 +:2063E000204D4252205369676E61747572650D00566F6C756D65204E616D653A20005646AE +:206400004154204E616D6520203A20004469726563746F727920203A200046696C656E610E +:206420006D652020203A20002C20436C75737465723A002C2053697A653A00A9FF8F4801C7 +:20644000008F4901008F4A0100A9FF8F4C01008F4D01008F4E010020DB56209767202E6825 +:2064600020A26420E464A9388569A9428F6A0000A20000A900EBDABF181038AA20B965FACA +:20648000E8E00900D0ED2279303820C36422B13038207A6520AE55201D5B20535858EAEA38 +:2064A00080FC48A9E98F1200AFA9008F1000AFC230A900008F1400AFA900008F1600AFE273 +:2064C000206860AF40010029848F400100AF41010029A18F410100A97B8F4C0100A95E8F45 +:2064E0004D010060A9008F150F388548646C6449A9018F190F38A648BF24FC391A8F180FA1 +:206500003820A15A6048A900EBAF4800001ACFD36A38D002A9008F480000AAA0900120A3A7 +:2065200057BF24FC391A8F180F3868608BA90048ABA9038D00019C01019C030138AF170F70 +:2065400038E9048D0201C220AD0401AAE220A9008D61018D62018D6301BF00003A8D6501E1 +:20656000BF01003A8D6601BF02003A8D6701A9018D6401A90B8D6001AB608BA90048ABE2EB +:2065800020A9008D61018D62018D6301A9018D6401A90B8D6001AB60A9808F04E6AF20B2F6 +:2065A00065A9108F02E6AF8F03E6AFA9038F04E6AF60A23002CAD0FD60AF6A00008F0001C8 +:2065C00000A9008F0101008F030100A9168F020100C220AF04010018693B108567E220AF9E +:2065E0006A0000A0A30120A357A767D04BE667D002E668203966E667D002E66820A966E6FC +:2066000067D002E66820E366E667D002E668201F67E667D002E668DAA627205B67FAE6673A +:20662000D002E668207767C220A5676906008567E220A0A801202F5860A767484848489FD4 +:2066400020E7AF2980A03D0220E057682940A08D0220E057682920A0DD0220E05768291026 +:20666000A02D0320E05768290FA07E0320A357A00600B767484848489F23E7AF2980A0573C +:206680000220E057682940A0A70220E057682920A0F70220E057682910A0470320E0576845 +:2066A000290FA0980320A35760A767489F40E7AF29C02A2A2AA0CE0320A35768293FA01EA2 +:2066C0000420A357A00600B767489F43E7AF29C02A2A2AA0E80320A35768293FA038042040 +:2066E000A35760A767489F60E7AF29F04A4A4A4AA06E0420A35768290FA0BE0420A357A02C +:206700000600B767489F63E7AF29F04A4A4A4AA0880420A35768290FA0D80420A35760A7B1 +:2067200067489F80E7AF29F04A4A4A4AA00E0520A35768290FA05E0520A357A00600B76766 +:20674000489F83E7AF29F04A4A4A4AA0280520A35768290FA0780520A35760A7674809F08B +:206760009FC0E7AF290E4AA0680620A357682901A0B80620A35760A7679FE0E7AF2907A01E +:20678000AE0520A357A00500B7679FE3E7AF2907A0C80520A357600B48DA0818E220A90042 +:2067A0008D870F204568A9AA8F6410AF205068AF6010AFC955F003826F00A9AB8F6410AF36 +:2067C000205068AF6010AFC900F003825B00A9608F6410AF204568A9698F6010AF20456865 +:2067E000A9FF8F6010AFA2FFFFCAEAEAEAEAEAEAEAEAE00000D0F2205068AF6010AF2045DC +:2068000068A9F48F6010AF205068AF6010AFC9FAD0EC205B68AF40010029808F400100AFA5 +:2068200041010029018F41010028FA682B60C230A2804DA90001A0000554AF38E220A9016F +:206840008F0007AF60AF6410AF2902C902F0F660AF6410AF2901C901D0F660204568A9A87B +:206860008F6410AF204568A9A98F6410AF205068AF6010AFC900D0EC204568A9208F6410D1 +:20688000AF205068AF6010AF090248204568A9608F6410AF204568688F6010AFA9F620C165 +:2068A0006820D468A9E820C16820D468A90020C16820D468A9F420C16820D468A90085E040 +:2068C0006048204568A9D48F6410AF204568688F6010AF60205068AF6010AF6048DAE210B7 +:2068E000AA3035BF336938C210A0960020A3578F300000302329704A4A4A4A8F310000AF92 +:20690000300000290F8F300000A9008F27000020F53722013238E220C210FA68600101017F +:20692000010101010101AACABF1D693849019F1D69386080808031338036383A804180808C +:206940008080802C32343537393B3C4280808080808021238026282A808080808080801CEF +:2069600022242527292B808080808080808080808080808080808080808080808080808031 +:20698000808080808080808080808080808080808080800256025682568256AB56AB568293 +:2069A00056C256DA56C210A9028F150F3822745C38A9008D1F03A93485536452645120CA45 +:2069C0006920F569203B6AE2106BA900A00004975188D0FBA53FF01C22D75C3822D35F381D +:2069E000C220A900668580A9000085828586227F6038E22060C230A900A0850CA900C08591 +:206A000017E220A9AF850E8519A03E03A9288580A28F03861AA20000A9148581BF804E381F +:206A2000970CA9509717C8E8C681D0F0C2209818693C00A8E220C680D0DE6064516452A90C +:206A4000348553A20000A00B00B751F02422B55B38C220A51A18693E00851AA551691200E7 +:206A60008551C98004B00AE8E02600F004E22080D5E220A90522175C3860A900EBAD1F03C0 +:206A8000C2308D0001A912008D0201AD04018551A900808580A937008582A01000B75122B4 +:206AA0005F6138E22022B1303822D66A3822B26A386B20E46420DB56204B59205358201DA1 +:206AC0005B20A15A6B439044914546924793419442430000060022B1303820026DA200006A +:206AE000A9009F000039E8D0F9C230A900808508A93700850AE220A01000B708C910D0052E +:206B000022626B386BC921D004220E6B386BA9028FD26A38201B6B20ED6B6BA01100B70840 +:206B20008940F017A9018FD56A38A90F8D6501A9018D6601A90C8D670180238920F00AC8D4 +:206B4000C220B708E220C88015A9008FD56A38A9988D6501A95E8D6601A9048D6701207A1B +:206B60006560A9018FD26A3820806B20006C20256C201B6B6B0701080209030A04050B0608 +:206B8000C8B708291F8FD46A38B7082980F007C8B708C900D0F9C8A93885F2E220B708F0D8 +:206BA0004AC2203A8F000100A916008F020100AF04010018693B1085F0A90000E220C864C2 +:206BC0004E87F0A64EBF756B38AAB7085A9B97F07AC8E64EA54EC90B90E95AA00C00A920BB +:206BE00097F0C8C01600D0F87A80B0C860B708C8C900D0F9A93885F2E220B708F000C8608C +:206C0000B7088FD36A38AAC8C220A924FC85F0A9390085F2E220B708C887F0E6F0B002E658 +:206C2000F1CAD0F26064F3A93985F6C220B708F01F5AA8A5F329FF008F000100A901078F81 +:206C4000020100AF0401001A85F4E220205D6C7AC8C8E220E6F3A5F3C920D0CF60B7088F4C +:206C6000420000C8C220297F008F000100A91C008F020100AF0401001A8FFA0000E220A69A +:206C8000FAB708C88FF90000290F8FF70000C2208A1865F765F765F7AAE220B7085A9B979E +:206CA000F47AC8E8B7085A9B97F47AC8E8290FF009B7085A9B97F47AC8E8AFF9000010BF3C +:206CC000AF4200001097605ADAA21200A00000A92D970CC8CAD0FAFA7A605AA5F620A3577C +:206CE000C8C8A5F520A357C8C8A5F420A3577A604848E2206820A35788886820A357C220AB +:206D000068605AC220A900E7852CA9AF00852EE220A0A000A900972CC8C0B900D0F87A6092 +:206D20005A20C76CC220AF180F3829FF003A8F000100A901078F020100AF0401001A85F43A +:206D4000E220A93985F6A0A00020DA6CC220A56C297F008F000100A91C008F020100AF04F9 +:206D600001001AA0520020F06CA8A90000E22064288F270000AABF1D6938D005C8C8C88021 +:206D800058B7F4297F20406FB7F429804A4A4A854EC8B7F429F04A4A4A4A654EF0143A8F40 +:206DA0006A00005AA627A900EBBF181038AA20B9657AAF300000F011C90FF02BC2205A20FE +:206DC000F537220132387AE220A900EBB7F4C8290FF0050AAAFCF86DC8A900EBAF27000003 +:206DE0001AC909D08C7A60AF2700001869B0852CA900872CC8C880E1186E8B6E8B6E186E6E +:206E0000186E186E186E186E186E186E196E186E016F706E186E816E605AB7F4854CC22066 +:206E2000A900E7852CA9AF00852EE230A527AABF181038186940A8B72C48293F18654CC9D1 +:206E4000409002A93F293F854E6829C0054E972CC8C8C8B72C48293F18654CC9409002A9DE +:206E60003F293F854E6829C0054E972CC2107A60B7F43A856CA9008F190F382005657A7A99 +:206E800060B7F48FD46A3820A15A605A4A8550B7F4854CC220A900E7852CA9AF00852EE262 +:206EA00030A5271869A0A8B72CC210BBA05A0020A3579BE2104898186910A8B72C854EC26B +:206EC00010BBA0A80020A3572903A0580020A3579BEB68AAA5508902F00AC2208A38E54C60 +:206EE000E2208008C2208A18654CE220E210EB2903054E972C9838E910A8EB972CC2107A47 +:206F0000605AC220A900E7852CA9AF00852EE220B7F4297FF0013A493F854EE210A627BF30 +:206F2000181038186940A8B72C29C018654E972CC8C8C8B72C29C018654E972CC2107A60D0 +:206F40005A4848AF2700000AA868F00320A35729704A4A4A4A8F31000068290F8F3000006A +:206F60007A605AE220A9018526C220A93800850AA53229FF003A0A0A0A0A18693B1085087A +:206F8000C220A9200022F53738E220A00000B708872CC220A9400022F53738E220A00200B7 +:206FA000B708872CC220A9600022F53738E220A00400B708872CC220A9800022F53738E263 +:206FC00020A00600B708872CC220A9E00022F53738E220A00900B708290F872CA9008526DF +:206FE000C220A9200022F53738E220A00100B708872CC220A9400022F53738E220A0030055 +:20700000B708872CC220A9600022F53738E220A00500B708872CC220A9800022F53738E201 +:2070200020A07100B708872CC220A9E00022F53738E220A00900B70829F04A4A4A4A872C5E +:20704000A52718290F69C0852AA900852BC23018A900E7652A852CA9AF00852EE220A00854 +:0770600000B708872C7A60DD :020000040039C1 :200000000101000000000000000000000000000000000000000000000000000000020000DC :200020000000000000000000000000000000000000000000000000000003000000000000BD diff --git a/tracker.lst b/tracker.lst index 736fdce..b88fa69 100644 --- a/tracker.lst +++ b/tracker.lst @@ -1,7 +1,7 @@ -; 64tass Turbo Assembler Macro V1.54.1900 listing file +; 64tass Turbo Assembler Macro V1.55.2200 listing file ; 64tass.exe --long-address -x --intel-hex -o tracker.hex --list tracker.lst tracker.asm -; Fri Aug 28 01:06:30 2020 +; Tue Sep 13 22:53:35 2022 ;Offset ;Hex ;Monitor ;Source @@ -744,7 +744,7 @@ =$000144 INT_POL_REG0 = $000144 ; =$000145 INT_POL_REG1 = $000145 ; =$000146 INT_POL_REG2 = $000146 ; -=$000147 INT_POL_REG7 = $000147 ; FMX Model +=$000147 INT_POL_REG3 = $000147 ; FMX Model =$000148 INT_EDGE_REG0 = $000148 ; =$000149 INT_EDGE_REG1 = $000149 ; =$00014a INT_EDGE_REG2 = $00014A ; @@ -768,7 +768,7 @@ =$10 FNX1_INT04_COM1 = $10 ;Serial Port 1 =$20 FNX1_INT05_MPU401 = $20 ;Midi Controller Interrupt =$40 FNX1_INT06_LPT = $40 ;Parallel Port -=$80 FNX1_INT07_SDCARD = $80 ;SD Card Controller Interrupt (CH376S) +=$80 FNX1_INT07_SDCARD = $80 ;SD Card Controller Interrupt (CH376S) =$01 FNX2_INT00_OPL3 = $01 ;OPl3 =$02 FNX2_INT01_GABE_INT0 = $02 ;GABE (INT0) - TBD =$04 FNX2_INT02_GABE_INT1 = $04 ;GABE (INT1) - TBD @@ -809,10 +809,13 @@ =$81 CHAR_COPY = $81 =613 ORDER_EDITOR_SCR = SCREEN_WIDTH * 7 + 53 =2164 PTRN_EDITOR_SCR = SCREEN_WIDTH * 27 + 4 + +;****** Processing file: base.asm + .38ff00 18 clc CLC .38ff01 fb xce XCE ; go into native mode .38ff02 78 sei SEI ; ignore interrupts -.38ff03 5c d3 63 38 jmp $3863d3 JML TRACKER +.38ff03 5c 3b 64 38 jmp $38643b JML TRACKER .38ff60 RHIRQ .38ff60 c2 30 rep #$30 REP #$30 ; set A&X long .38ff62 8b phb PHB @@ -827,14 +830,14 @@ .38ff6e 2b pld PLD .38ff6f ab plb PLB .38ff70 40 rti RTI -.38ffe0 5c d3 63 38 jmp $3863d3 JUMP_READY JML TRACKER ; Kernel READY routine. Rewrite this address to jump to a custom kernel. +.38ffe0 5c 3b 64 38 jmp $38643b JUMP_READY JML TRACKER ; Kernel READY routine. Rewrite this address to jump to a custom kernel. >38ffe4 10 ff RVECTOR_COP .addr HCOP ; FFE4 >38ffe6 20 ff RVECTOR_BRK .addr HBRK ; FFE6 >38ffe8 30 ff RVECTOR_ABORT .addr HABORT ; FFE8 >38ffea 40 ff RVECTOR_NMI .addr HNMI ; FFEA >38ffec 00 00 .word $0000 ; FFEC >38ffee 60 ff RVECTOR_IRQ .addr HIRQ ; FFEE -.38fff0 5c d3 63 38 jmp $3863d3 RRETURN JML TRACKER +.38fff0 5c 3b 64 38 jmp $38643b RRETURN JML TRACKER >38fff4 10 ff RVECTOR_ECOP .addr HCOP ; FFF4 >38fff6 20 ff RVECTOR_EBRK .addr HBRK ; FFF6 >38fff8 30 ff RVECTOR_EABORT .addr HABORT ; FFF8 @@ -842,6 +845,9 @@ >38fffc 00 ff RVECTOR_ERESET .addr HRESET ; FFFC >38fffe 60 ff RVECTOR_EIRQ .addr HIRQ ; FFFE +;****** Return to file: tracker.asm + + ;****** Processing file: OPL2_library.asm @@ -2009,7 +2015,7 @@ .3830ab e0 08 00 cpx #$0008 CPX #8 .3830ae d0 d0 bne $383080 BNE OPL2_TONE_TESTING_L1 .3830b0 6b rtl RTL -.3830b1 OPL2_INIT +.3830b1 OPL3_INIT .3830b1 c2 20 rep #$20 REP #$20 ; set A long .3830b3 a9 00 00 lda #$0000 LDA #$0000 .3830b6 85 28 sta $28 STA OPL2_REG_REGION @@ -3157,6 +3163,7 @@ ;****** Processing file: display.asm =80 SCREEN_WIDTH = 80 +=64 MUSICAL_LINES_PER_BAR = 64 .383b80 TRACKER_SCREEN >383b80 d5 line1 .byte $D5 >383b81 c3 c3 c3 c3 c3 c3 c3 c3 .fill SCREEN_WIDTH - 2, $C3 @@ -3176,8 +3183,8 @@ >383c35 43 32 35 36 20 46 6f 65 .text 'C256 Foenix Tracker' ; 19 characters >383c3d 6e 69 78 20 54 72 61 63 6b 65 72 >383c48 00 00 00 00 .fill 4, 0 ->383c4c 5b 56 65 72 73 69 6f 6e .text '[Version 0.3.1]' ; 15 characters ->383c54 20 30 2e 33 2e 31 5d +>383c4c 5b 56 65 72 73 69 6f 6e .text '[Version 0.4.0]' ; 15 characters +>383c54 20 30 2e 34 2e 30 5d >383c5b 00 00 00 00 00 00 00 00 .fill (SCREEN_WIDTH - 40) / 2, 0 >383c63 00 00 00 00 00 00 00 00 00 00 00 00 >383c6f c2 .byte $c2 @@ -3217,7 +3224,7 @@ >383d4b c2 .byte $c2 >383d4c 00 .fill 1,0 >383d4d 4d 49 44 49 .text 'MIDI' ->383d51 00 00 00 00 00 00 00 00 .fill 14,0 +>383d51 00 00 00 00 00 00 00 00 .fill SCREEN_WIDTH -66,0 >383d59 00 00 00 00 00 00 >383d5f c2 .byte $c2 >383d60 ab line7 .byte $ab @@ -3651,7 +3658,7 @@ >3842db 00 00 .fill 2, 0 >3842dd 46 69 6c 65 3a 20 20 20 .text 'File: ' ; 17 chars >3842e5 20 20 20 20 20 20 20 20 20 ->3842ee 00 00 00 00 00 00 00 00 .fill 17, 0 +>3842ee 00 00 00 00 00 00 00 00 .fill SCREEN_WIDTH - 63, 0 >3842f6 00 00 00 00 00 00 00 00 00 >3842ff c2 .byte $c2 >384300 ca line25 .byte $ca @@ -3668,7 +3675,7 @@ >38432a b1 .byte $b1 >38432b c3 c3 c3 c3 c3 c3 c3 c3 .fill 8, $C3 >384333 c3 .byte $c3 ->384334 c3 c3 c3 c3 c3 c3 c3 c3 .fill 27, $C3 +>384334 c3 c3 c3 c3 c3 c3 c3 c3 .fill SCREEN_WIDTH - 53, $C3 >38433c c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 c3 >38434c c3 c3 c3 >38434f cb .byte $cb @@ -3690,6 +3697,7 @@ >38438f c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 >384397 b2 .byte $b2 >384398 c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 +>3843a0 .fill SCREEN_WIDTH - 80, 0 .3843a0 line27 >3843a0 20 2d 20 31 20 20 2d 20 .text ' - ',col,' - ' >3843a8 c2 .byte $c2 @@ -3708,6 +3716,7 @@ >3843df 20 2d 20 38 20 20 2d 20 .text ' - ',col,' - ' >3843e7 c2 .byte $c2 >3843e8 20 2d 20 39 20 20 2d 20 .text ' - 9 - ' +>3843f0 .fill SCREEN_WIDTH - 80, 0 .3843f0 btm_line >3843f0 c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 >3843f8 b1 .byte $b1 @@ -3726,11 +3735,13 @@ >38442f c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 >384437 b1 .byte $b1 >384438 c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 +>384440 .fill SCREEN_WIDTH - 80, 0 .384440 blank_line >384440 20 20 20 20 20 20 20 20 .fill 80, $20 >384448 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ; ...repeated 3 times (48 bytes)... >384488 20 20 20 20 20 20 20 20 +>384490 .fill SCREEN_WIDTH - 80, 0 .384490 tick_line >384490 2d 2d 2d 20 2d 2d 2d 2d .text '--- ----' >384498 db .byte $db @@ -3749,6 +3760,7 @@ >3844cf 2d 2d 2d 20 2d 2d 2d 2d .text '--- ----' >3844d7 db .byte $db >3844d8 2d 2d 2d 20 2d 2d 2d 2d .text '--- ----' +>3844e0 .fill SCREEN_WIDTH - 80, 0 .3844e0 untick_line >3844e0 2d 2d 2d 20 2d 2d 2d 2d .text '--- ----' >3844e8 c2 .byte $c2 @@ -3767,6 +3779,7 @@ >38451f 2d 2d 2d 20 2d 2d 2d 2d .text '--- ----' >384527 c2 .byte $c2 >384528 2d 2d 2d 20 2d 2d 2d 2d .text '--- ----' +>384530 .fill SCREEN_WIDTH - 80, 0 .384530 line60 >384530 c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 >384538 b1 .byte $b1 @@ -3785,6 +3798,7 @@ >38456f c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 >384577 b1 .byte $b1 >384578 c3 c3 c3 c3 c3 c3 c3 c3 .fill 8,$c3 +>384580 .fill SCREEN_WIDTH - 80, 0 .384580 FNXFONT >384580 00 00 00 00 00 00 00 00 .binary "Font/FOENIX-CHARACTER-ASCII-2.bin", 0, 2048 >384588 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -4196,25 +4210,25 @@ .385249 8d 88 0f sta $0f88 STA KEYBOARD_SC_TMP ; Save Code Immediately .38524c c2 10 rep #$10 REP #$10 ; set X long .38524e a0 46 00 ldy #$0046 LDY #70 -.385251 20 b1 57 jsr $3857b1 JSR WRITE_HEX ; print the HEX key code at column 70 on the top line +.385251 20 a3 57 jsr $3857a3 JSR WRITE_HEX ; print the HEX key code at column 70 on the top line .385254 c9 01 cmp #$01 CMP #1 ; ESC .385256 d0 0f bne $385267 BNE NOT_ESCAPE .385258 af 15 0f 38 lda $380f15 LDA STATE_MACHINE .38525c c9 02 cmp #$02 CMP #2 .38525e d0 07 bne $385267 BNE NOT_ESCAPE -.385260 22 47 6a 38 jsl $386a47 JSL EXIT_FILE +.385260 22 b2 6a 38 jsl $386ab2 JSL EXIT_FILE .385264 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .385267 NOT_ESCAPE .385267 c9 1a cmp #$1a CMP #$1A ; left bracket .385269 d0 08 bne $385273 BNE NOT_LEFT_BRACKET .38526b c6 6a dec $6a DEC INSTR_NUMBER -.38526d 20 4e 65 jsr $38654e JSR LOAD_INSTRUMENT ; X is already set to 0 +.38526d 20 b9 65 jsr $3865b9 JSR LOAD_INSTRUMENT ; X is already set to 0 .385270 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .385273 NOT_LEFT_BRACKET .385273 c9 1b cmp #$1b CMP #$1B ; right bracket .385275 d0 08 bne $38527f BNE NOT_RIGHT_BRACKET .385277 e6 6a inc $6a INC INSTR_NUMBER -.385279 20 4e 65 jsr $38654e JSR LOAD_INSTRUMENT ; X is already set to 0 +.385279 20 b9 65 jsr $3865b9 JSR LOAD_INSTRUMENT ; X is already set to 0 .38527c 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .38527f NOT_RIGHT_BRACKET .38527f c9 0c cmp #$0c CMP #$0C ; minus @@ -4230,7 +4244,7 @@ .385295 e9 01 sbc #$01 SBC #1 .385297 8f 18 0f 38 sta $380f18 STA PATTERN_NUM .38529b d8 cld CLD ; switch out of decimal -.38529c 20 61 58 jsr $385861 JSR DISPLAY_PATTERN +.38529c 20 53 58 jsr $385853 JSR DISPLAY_PATTERN .38529f MINUS_DONE .38529f 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .3852a2 NOT_MINUS @@ -4247,7 +4261,7 @@ .3852b8 69 01 adc #$01 ADC #1 .3852ba 8f 18 0f 38 sta $380f18 STA PATTERN_NUM .3852be d8 cld CLD ; switch out of decimal -.3852bf 20 61 58 jsr $385861 JSR DISPLAY_PATTERN +.3852bf 20 53 58 jsr $385853 JSR DISPLAY_PATTERN .3852c2 PLUS_DONE .3852c2 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .3852c5 BPM_KEYS @@ -4267,8 +4281,8 @@ .3852e0 1a inc a INC A .3852e1 SETUP_TIMER .3852e1 8f 17 0f 38 sta $380f17 STA BPM -.3852e5 20 c9 5a jsr $385ac9 JSR DISPLAY_BPM -.3852e8 20 c1 64 jsr $3864c1 JSR INIT_TIMER0_BPM +.3852e5 20 bb 5a jsr $385abb JSR DISPLAY_BPM +.3852e8 20 2c 65 jsr $38652c JSR INIT_TIMER0_BPM .3852eb 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .3852ee TRY_GRAVE .3852ee c9 29 cmp #$29 CMP #$29 @@ -4282,9 +4296,9 @@ .3852fd 4a lsr a LSR .3852fe aa tax TAX .3852ff 68 pla PLA -.385300 5f cd 5a 38 eor $385acd,x EOR HL_CLR_TABLE+3,X +.385300 5f bf 5a 38 eor $385abf,x EOR HL_CLR_TABLE+3,X .385304 8f 15 0f 38 sta $380f15 STA STATE_MACHINE -.385308 20 d6 5a jsr $385ad6 JSR HIGHLIGHT_MODE +.385308 20 c8 5a jsr $385ac8 JSR HIGHLIGHT_MODE .38530b 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN .38530e SPECIAL_KEYS .38530e c9 2a cmp #$2a CMP #$2A ; Left Shift Pressed @@ -4321,7 +4335,7 @@ .385348 UP_WRONG_STATE .385348 c9 02 cmp #$02 CMP #2 .38534a d0 04 bne $385350 BNE UP_WRG_DONE -.38534c 22 6b 5c 38 jsl $385c6b JSL SELECT_PREVIOUS_FILE +.38534c 22 5d 5c 38 jsl $385c5d JSL SELECT_PREVIOUS_FILE .385350 UP_WRG_DONE .385350 68 pla PLA .385351 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN @@ -4336,7 +4350,7 @@ .385364 DOWN_WRONG_STATE .385364 c9 02 cmp #$02 CMP #2 .385366 d0 04 bne $38536c BNE DOWN_WRG_DONE -.385368 22 52 5c 38 jsl $385c52 JSL SELECT_NEXT_FILE +.385368 22 44 5c 38 jsl $385c44 JSL SELECT_NEXT_FILE .38536c DOWN_WRG_DONE .38536c 68 pla PLA .38536d 4c e9 53 jmp $3853e9 JMP KB_WR_2_SCREEN @@ -4367,7 +4381,7 @@ .38539f f0 35 beq $3853d6 BEQ ALT_KEY_ON .3853a1 c2 10 rep #$10 REP #$10 ; set X long .3853a3 ad 88 0f lda $0f88 LDA KEYBOARD_SC_TMP -.3853a6 20 71 68 jsr $386871 JSR PLAY_TRACKER_NOTE +.3853a6 20 dc 68 jsr $3868dc JSR PLAY_TRACKER_NOTE .3853a9 e2 10 sep #$10 SEP #$10 ; set X short .3853ab ae 88 0f ldx $0f88 LDX KEYBOARD_SC_TMP .3853ae bf 00 39 38 lda $383900,x LDA @lScanCode_Press_Set1, x @@ -4382,21 +4396,21 @@ .3853ca 29 0f and #$0f AND #$F .3853cc c9 02 cmp #$02 CMP #2 .3853ce f0 04 beq $3853d4 BEQ CONTINUE_KEY -.3853d0 22 3a 69 38 jsl $38693a JSL LOAD_FILE_DISPLAY +.3853d0 22 a5 69 38 jsl $3869a5 JSL LOAD_FILE_DISPLAY .3853d4 CONTINUE_KEY .3853d4 80 13 bra $3853e9 BRA KB_WR_2_SCREEN .3853d6 bf 80 3a 38 lda $383a80,x ALT_KEY_ON LDA @lScanCode_Alt_Set1, x .3853da f0 0d beq $3853e9 BEQ KB_WR_2_SCREEN .3853dc 29 0f and #$0f AND #$F -.3853de 20 bb 68 jsr $3868bb JSR TOGGLE_CHANNEL +.3853de 20 26 69 jsr $386926 JSR TOGGLE_CHANNEL .3853e1 c2 10 rep #$10 REP #$10 ; set X long -.3853e3 20 6d 5b jsr $385b6d JSR DISPLAY_ACTIVE_CHANNELS +.3853e3 20 5f 5b jsr $385b5f JSR DISPLAY_ACTIVE_CHANNELS .3853e6 e2 10 sep #$10 SEP #$10 ; set X short .3853e8 60 rts RTS ; early exit .3853e9 KB_WR_2_SCREEN .3853e9 c2 10 rep #$10 REP #$10 ; set X long .3853eb a0 4a 00 ldy #$004a LDY #74 -.3853ee 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.3853ee 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3853f1 c9 0d cmp #$0d CMP #$0D ; Enter Key Pressed .3853f3 d0 1f bne $385414 BNE KB_CHECK_B_DONE_R .3853f5 48 pha PHA @@ -4410,19 +4424,19 @@ .385406 8f 4c 01 00 sta $00014c STA @lINT_MASK_REG0 .38540a a9 00 lda #$00 LDA #0 ; record mode .38540c 8f 15 0f 38 sta $380f15 STA STATE_MACHINE -.385410 20 97 6c jsr $386c97 JSR RAD_ALL_NOTES_OFF +.385410 20 02 6d jsr $386d02 JSR RAD_ALL_NOTES_OFF .385413 68 pla PLA .385414 KB_CHECK_B_DONE_R .385414 4c 80 54 jmp $385480 JMP KB_CHECK_B_DONE .385417 START_SOF .385417 ad 87 0f lda $0f87 LDA KEYBOARD_SC_FLG .38541a d0 06 bne $385422 BNE CONTINUE_FROM_CURRENT_LOCATION -.38541c 20 79 64 jsr $386479 JSR RESET_STATE_MACHINE -.38541f 20 61 58 jsr $385861 JSR DISPLAY_PATTERN +.38541c 20 e4 64 jsr $3864e4 JSR RESET_STATE_MACHINE +.38541f 20 53 58 jsr $385853 JSR DISPLAY_PATTERN .385422 CONTINUE_FROM_CURRENT_LOCATION .385422 a9 01 lda #$01 LDA #1 .385424 8f 15 0f 38 sta $380f15 STA STATE_MACHINE -.385428 20 b5 6c jsr $386cb5 JSR RAD_PLAYNOTES +.385428 20 20 6d jsr $386d20 JSR RAD_PLAYNOTES .38542b af 4c 01 00 lda $00014c LDA @lINT_MASK_REG0 .38542f 29 fb and #$fb AND #~(FNX0_INT02_TMR0) .385431 8f 4c 01 00 sta $00014c STA @lINT_MASK_REG0 @@ -4430,7 +4444,7 @@ .385436 4c 80 54 jmp $385480 JMP KB_CHECK_B_DONE .385439 GO_LOAD_FILE .385439 68 pla PLA -.38543a 22 0f 6a 38 jsl $386a0f JSL READ_FILE +.38543a 22 7a 6a 38 jsl $386a7a JSL READ_FILE .38543e 4c 80 54 jmp $385480 JMP KB_CHECK_B_DONE .385441 ad 87 0f lda $0f87 KB_SET_SHIFT LDA KEYBOARD_SC_FLG .385444 09 10 ora #$10 ORA #$10 @@ -4470,7 +4484,7 @@ .385494 f0 45 beq $3854db BEQ EDIT_MODE .385496 af 16 0f 38 lda $380f16 LDA @lTICK .38549a 1a inc a INC A -.38549b cf 69 6a 38 cmp $386a69 CMP @lTuneInfo.InitialSpeed +.38549b cf d4 6a 38 cmp $386ad4 CMP @lTuneInfo.InitialSpeed .38549f d0 3c bne $3854dd BNE TICK_DONE .3854a1 INCR_LINE .3854a1 a5 6c lda $6c LDA LINE_NUM_HEX @@ -4490,15 +4504,15 @@ .3854bf d0 07 bne $3854c8 BNE INCR_DONE .3854c1 a9 01 lda #$01 LDA #1 .3854c3 64 6c stz $6c STZ LINE_NUM_HEX -.3854c5 20 9a 64 jsr $38649a JSR INCREMENT_ORDER +.3854c5 20 05 65 jsr $386505 JSR INCREMENT_ORDER .3854c8 INCR_DONE .3854c8 d8 cld CLD .3854c9 8f 19 0f 38 sta $380f19 STA @lLINE_NUM_DEC -.3854cd 20 61 58 jsr $385861 JSR DISPLAY_PATTERN +.3854cd 20 53 58 jsr $385853 JSR DISPLAY_PATTERN .3854d0 af 15 0f 38 lda $380f15 LDA STATE_MACHINE .3854d4 29 01 and #$01 AND #1 .3854d6 f0 03 beq $3854db BEQ EDIT_MODE -.3854d8 20 b5 6c jsr $386cb5 JSR RAD_PLAYNOTES +.3854d8 20 20 6d jsr $386d20 JSR RAD_PLAYNOTES .3854db EDIT_MODE .3854db a9 00 lda #$00 LDA #0 ; reset the tick to 0 .3854dd TICK_DONE @@ -4520,7 +4534,7 @@ .3854fe DECR_DONE .3854fe d8 cld CLD .3854ff 8f 19 0f 38 sta $380f19 STA @lLINE_NUM_DEC -.385503 20 61 58 jsr $385861 JSR DISPLAY_PATTERN +.385503 20 53 58 jsr $385853 JSR DISPLAY_PATTERN .385506 a9 00 lda #$00 LDA #0 ; reset the tick to 0 .385508 8f 16 0f 38 sta $380f16 STA @lTICK .38550c 60 rts RTS @@ -4567,7 +4581,7 @@ .385562 af 00 0f 38 lda $380f00 LDA MOUSE_BUTTONS_REG .385566 c2 10 rep #$10 REP #$10 ; set X long .385568 a0 3c 00 ldy #$003c LDY #60 -.38556b 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.38556b 20 a3 57 jsr $3857a3 JSR WRITE_HEX .38556e e2 10 sep #$10 SEP #$10 ; set X short .385570 20 7a 55 jsr $38557a JSR MOUSE_BUTTON_HANDLER .385573 a2 00 ldx #$00 LDX #$00 @@ -4630,7 +4644,7 @@ .3855bd 8f 31 13 af sta $af1331 STA @lMIDI_STATUS_REG .3855c1 a0 66 03 ldy #$0366 LDY #10 * SCREEN_WIDTH + 70 .3855c4 af 30 13 af lda $af1330 MORE_DATA LDA @lMIDI_DATA_REG -.3855c8 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.3855c8 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3855cb c8 iny INY .3855cc c8 iny INY .3855cd af 31 13 af lda $af1331 LDA @lMIDI_STATUS_REG @@ -4663,7 +4677,7 @@ .3855f7 a5 62 lda $62 LDA MIDI_CTRL .3855f9 aa tax TAX .3855fa 68 pla PLA -.3855fb fc 28 69 jsr ($386928,x) JSR (MIDI_COMMAND_TABLE,X) +.3855fb fc 93 69 jsr ($386993,x) JSR (MIDI_COMMAND_TABLE,X) .3855fe c2 10 rep #$10 REP #$10 ; set X long .385600 RECEIVE_MIDI_DATA_DONE .385600 68 pla PLA @@ -4683,11 +4697,11 @@ .385614 c2 10 rep #$10 REP #$10 ; set X long .385616 a5 62 lda $62 LDA MIDI_CTRL .385618 a0 02 04 ldy #$0402 LDY #12*SCREEN_WIDTH + 66 -.38561b 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.38561b 20 a3 57 jsr $3857a3 JSR WRITE_HEX .38561e a5 64 lda $64 LDA MIDI_DATA1 .385620 8f 12 01 00 sta $000112 STA @lD0_OPERAND_B .385624 a0 04 04 ldy #$0404 LDY #12*SCREEN_WIDTH + 68 -.385627 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.385627 20 a3 57 jsr $3857a3 JSR WRITE_HEX .38562a a9 00 lda #$00 LDA #0 .38562c 8f 11 01 00 sta $000111 STA @lD0_OPERAND_A + 1 .385630 8f 13 01 00 sta $000113 STA @lD0_OPERAND_B + 1 @@ -4698,20 +4712,20 @@ .38563f e9 02 sbc #$02 SBC #2 .385641 85 31 sta $31 STA OPL2_OCTAVE .385643 a0 08 04 ldy #$0408 LDY #12*SCREEN_WIDTH + 72 -.385646 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.385646 20 a3 57 jsr $3857a3 JSR WRITE_HEX .385649 af 16 01 00 lda $000116 LDA @lD0_REMAINDER .38564d 85 30 sta $30 STA OPL2_NOTE .38564f a0 0a 04 ldy #$040a LDY #12*SCREEN_WIDTH + 74 -.385652 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.385652 20 a3 57 jsr $3857a3 JSR WRITE_HEX .385655 a5 65 lda $65 LDA MIDI_DATA2 .385657 a0 0c 04 ldy #$040c LDY #12*SCREEN_WIDTH + 76 -.38565a 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.38565a 20 a3 57 jsr $3857a3 JSR WRITE_HEX .38565d c9 00 cmp #$00 CMP #0 .38565f d0 0f bne $385670 BNE PLAY_NOTE_ON ; otherwise, turn note on .385661 85 32 sta $32 STA OPL2_PARAMETER0 .385663 a9 ff lda #$ff LDA #$FF .385665 a0 0e 04 ldy #$040e LDY #12*SCREEN_WIDTH + 78 -.385668 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.385668 20 a3 57 jsr $3857a3 JSR WRITE_HEX .38566b 20 c6 36 jsr $3836c6 JSR OPL2_SET_KEYON .38566e 80 0f bra $38567f BRA MORE_NOTE_DATA_NEEDED .385670 PLAY_NOTE_ON @@ -4737,13 +4751,13 @@ .38568e c2 10 rep #$10 REP #$10 ; set X long .385690 a5 62 lda $62 LDA MIDI_CTRL .385692 a0 a2 04 ldy #$04a2 LDY #14*SCREEN_WIDTH + 66 -.385695 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.385695 20 a3 57 jsr $3857a3 JSR WRITE_HEX .385698 a5 64 lda $64 LDA MIDI_DATA1 .38569a a0 a4 04 ldy #$04a4 LDY #14*SCREEN_WIDTH+68 -.38569d 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.38569d 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3856a0 a5 65 lda $65 LDA MIDI_DATA2 .3856a2 a0 a6 04 ldy #$04a6 LDY #14*SCREEN_WIDTH+70 -.3856a5 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.3856a5 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3856a8 64 60 stz $60 STZ MIDI_COUNTER .3856aa MORE_CTRL_DATA_NEEDED .3856aa 60 rts RTS @@ -4753,10 +4767,10 @@ .3856ac c2 10 rep #$10 REP #$10 ; set X long .3856ae a5 62 lda $62 LDA MIDI_CTRL .3856b0 a0 f2 04 ldy #$04f2 LDY #15*SCREEN_WIDTH + 66 -.3856b3 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.3856b3 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3856b6 68 pla PLA .3856b7 a0 f4 04 ldy #$04f4 LDY #15*SCREEN_WIDTH + 68 -.3856ba 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.3856ba 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3856bd a9 10 lda #$10 LDA #16 .3856bf 85 62 sta $62 STA MIDI_CTRL .3856c1 60 rts RTS @@ -4769,7 +4783,7 @@ .3856cd a9 00 lda #$00 LDA #0 .3856cf DISPLAY_COUNTER .3856cf a0 42 05 ldy #$0542 LDY #16*SCREEN_WIDTH + 66 -.3856d2 20 b1 57 jsr $3857b1 JSR WRITE_HEX +.3856d2 20 a3 57 jsr $3857a3 JSR WRITE_HEX .3856d5 8f 66 00 00 sta $000066 STA @lTIMING_CNTR .3856d9 60 rts RTS .3856da INVALID_COMMAND @@ -4781,797 +4795,789 @@ ;****** Processing file: display_func.asm .3856db DRAW_DISPLAY -.3856db a9 50 lda #$50 LDA #SCREEN_WIDTH -.3856dd 85 11 sta $11 STA COLS_PER_LINE -.3856df a9 40 lda #$40 LDA #64 -.3856e1 85 15 sta $15 STA LINES_MAX -.3856e3 a9 50 lda #$50 LDA #80 -.3856e5 85 0f sta $0f STA COLS_VISIBLE -.3856e7 a9 3c lda #$3c LDA #60 -.3856e9 85 13 sta $13 STA LINES_VISIBLE -.3856eb a9 00 lda #$00 LDA #0 -.3856ed 8f 08 00 af sta $af0008 STA BORDER_X_SIZE -.3856f1 8f 09 00 af sta $af0009 STA BORDER_Y_SIZE -.3856f5 e2 20 sep #$20 SEP #$20 ; set A short -.3856f7 a9 20 lda #$20 LDA #$20 -.3856f9 8f 05 00 af sta $af0005 STA BORDER_COLOR_B -.3856fd 8f 07 00 af sta $af0007 STA BORDER_COLOR_R -.385701 a9 00 lda #$00 LDA #0 -.385703 8f 06 00 af sta $af0006 STA BORDER_COLOR_G -.385707 a9 01 lda #$01 LDA #Border_Ctrl_Enable -.385709 8f 04 00 af sta $af0004 STA BORDER_CTRL_REG -.38570d a9 01 lda #$01 LDA #Mstr_Ctrl_Text_Mode_En -.38570f 8f 00 00 af sta $af0000 STA MASTER_CTRL_REG_L -.385713 c2 20 rep #$20 REP #$20 ; set A long -.385715 a9 00 a0 lda #$a000 LDA #<>CS_TEXT_MEM_PTR ; store the initial screen buffer location -.385718 85 0c sta $0c STA SCREENBEGIN -.38571a 85 17 sta $17 STA CURSORPOS -.38571c e2 20 sep #$20 SEP #$20 ; set A short -.38571e a9 af lda #$af LDA #`CS_TEXT_MEM_PTR -.385720 85 0e sta $0e STA SCREENBEGIN+2 -.385722 85 19 sta $19 STA CURSORPOS+2 -.385724 c2 30 rep #$30 REP #$30 ; set A&X long -.385726 a9 bf 08 lda #$08bf LDA #SCREEN_WIDTH*28-1 -.385729 a2 80 3b ldx #$3b80 LDX #<>TRACKER_SCREEN -.38572c a0 00 a0 ldy #$a000 LDY #<>CS_TEXT_MEM_PTR -.38572f 54 af 38 mvn $38,$af MVN #`TRACKER_SCREEN,#$AF -.385732 a9 00 08 lda #$0800 LDA #256 * 8 -.385735 a2 80 45 ldx #$4580 LDX #<>FNXFONT -.385738 a0 00 80 ldy #$8000 LDY #<>FONT_MEMORY_BANK0 -.38573b 54 af 38 mvn $38,$af MVN #`FNXFONT,#$AF -.38573e a9 ff 60 lda #$60ff LDA #$60FF -.385741 8f 48 1f af sta $af1f48 STA FG_CHAR_LUT_PTR + 8; -.385745 8f 88 1f af sta $af1f88 STA BG_CHAR_LUT_PTR + 8; -.385749 a9 80 00 lda #$0080 LDA #$0080 -.38574c 8f 4a 1f af sta $af1f4a STA FG_CHAR_LUT_PTR + 10; -.385750 8f 8a 1f af sta $af1f8a STA BG_CHAR_LUT_PTR + 10; -.385754 a9 20 80 lda #$8020 LDA #$8020 -.385757 8f 4c 1f af sta $af1f4c STA FG_CHAR_LUT_PTR + 12; -.38575b 8f 8c 1f af sta $af1f8c STA BG_CHAR_LUT_PTR + 12; -.38575f a9 10 00 lda #$0010 LDA #$0010 -.385762 8f 4e 1f af sta $af1f4e STA FG_CHAR_LUT_PTR + 14; -.385766 8f 8e 1f af sta $af1f8e STA BG_CHAR_LUT_PTR + 14; -.38576a a9 cc cc lda #$cccc LDA #$CCCC -.38576d 8f 50 1f af sta $af1f50 STA FG_CHAR_LUT_PTR + 16; -.385771 8f 90 1f af sta $af1f90 STA BG_CHAR_LUT_PTR + 16; -.385775 a9 cc 00 lda #$00cc LDA #$00CC -.385778 8f 52 1f af sta $af1f52 STA FG_CHAR_LUT_PTR + 18; -.38577c 8f 92 1f af sta $af1f92 STA BG_CHAR_LUT_PTR + 18; -.385780 a9 22 dd lda #$dd22 LDA #$DD22 -.385783 8f 54 1f af sta $af1f54 STA FG_CHAR_LUT_PTR + 20; -.385787 8f 94 1f af sta $af1f94 STA BG_CHAR_LUT_PTR + 20; -.38578b a9 dd 00 lda #$00dd LDA #$00DD -.38578e 8f 56 1f af sta $af1f56 STA FG_CHAR_LUT_PTR + 22; -.385792 8f 96 1f af sta $af1f96 STA BG_CHAR_LUT_PTR + 22; -.385796 a2 00 14 ldx #$1400 LDX #SCREEN_WIDTH*64 -.385799 e2 20 sep #$20 SEP #$20 ; set A short -.38579b a9 20 lda #$20 LDA #$20 -.38579d SETTEXTCOLOR -.38579d 9f ff bf af sta $afbfff,x STA CS_COLOR_MEM_PTR-1,X -.3857a1 ca dex DEX -.3857a2 d0 f9 bne $38579d BNE SETTEXTCOLOR -.3857a4 a0 e0 0b ldy #$0be0 LDY #38 * SCREEN_WIDTH -.3857a7 20 79 5a jsr $385a79 JSR REVERSE_LUT -.3857aa 20 d6 5a jsr $385ad6 JSR HIGHLIGHT_MODE -.3857ad 20 6d 5b jsr $385b6d JSR DISPLAY_ACTIVE_CHANNELS -.3857b0 60 rts RTS -.3857b1 WRITE_HEX -.3857b1 48 pha PHA -.3857b2 da phx PHX -.3857b3 5a phy PHY -.3857b4 8f 01 0f 38 sta $380f01 STA @lTEMP_STORAGE -.3857b8 29 f0 and #$f0 AND #$F0 -.3857ba 4a lsr a lsr A -.3857bb 4a lsr a lsr A -.3857bc 4a lsr a lsr A -.3857bd 4a lsr a lsr A -.3857be e2 10 sep #$10 SEP #$10 ; set X short -.3857c0 aa tax TAX -.3857c1 bf 05 0f 38 lda $380f05,x LDA HEX_MAP,X -.3857c5 8f 03 0f 38 sta $380f03 STA @lLOW_NIBBLE -.3857c9 af 01 0f 38 lda $380f01 LDA @lTEMP_STORAGE -.3857cd 29 0f and #$0f AND #$0F -.3857cf aa tax TAX -.3857d0 bf 05 0f 38 lda $380f05,x LDA HEX_MAP,X -.3857d4 8f 04 0f 38 sta $380f04 STA @lHIGH_NIBBLE -.3857d8 c2 30 rep #$30 REP #$30 ; set A&X long -.3857da 7a ply PLY -.3857db af 03 0f 38 lda $380f03 LDA @lLOW_NIBBLE -.3857df 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.3857e1 a9 30 30 lda #$3030 LDA #$3030 -.3857e4 bb tyx TYX -.3857e5 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.3857e9 e2 20 sep #$20 SEP #$20 ; set A short -.3857eb fa plx PLX -.3857ec 68 pla PLA -.3857ed 60 rts RTS -.3857ee WRITE_OFF_ON -.3857ee da phx PHX -.3857ef c9 00 cmp #$00 CMP #0 -.3857f1 f0 25 beq $385818 BEQ DISPLAY_OFF -.3857f3 a9 4f lda #$4f LDA #'O' -.3857f5 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.3857f7 a9 30 lda #$30 LDA #$30 -.3857f9 bb tyx TYX -.3857fa 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.3857fe c8 iny INY -.3857ff a9 6e lda #$6e LDA #'n' -.385801 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385803 a9 30 lda #$30 LDA #$30 -.385805 bb tyx TYX -.385806 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.38580a c8 iny INY -.38580b a9 20 lda #$20 LDA #$20 -.38580d 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.38580f a9 30 lda #$30 LDA #$30 -.385811 bb tyx TYX -.385812 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.385816 80 23 bra $38583b BRA ON_OFF_DONE -.385818 DISPLAY_OFF -.385818 a9 4f lda #$4f LDA #'O' -.38581a 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.38581c a9 30 lda #$30 LDA #$30 -.38581e bb tyx TYX -.38581f 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.385823 c8 iny INY -.385824 a9 66 lda #$66 LDA #'f' -.385826 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385828 a9 30 lda #$30 LDA #$30 -.38582a bb tyx TYX -.38582b 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.38582f c8 iny INY -.385830 a9 66 lda #$66 LDA #'f' -.385832 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385834 a9 30 lda #$30 LDA #$30 -.385836 bb tyx TYX -.385837 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.38583b ON_OFF_DONE -.38583b fa plx PLX -.38583c 60 rts RTS -.38583d WRITE_INSTRUMENT_NAME -.38583d a9 0a lda #$0a LDA #10 -.38583f 8f 01 0f 38 sta $380f01 STA @lTEMP_STORAGE -.385843 WRITE_CHAR -.385843 a7 67 lda [$67] LDA [INSTR_ADDR] -.385845 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385847 e6 67 inc $67 INC INSTR_ADDR -.385849 d0 02 bne $38584d BNE WRITE_CONTINUE -.38584b e6 68 inc $68 INC INSTR_ADDR + 1 -.38584d WRITE_CONTINUE -.38584d a9 30 lda #$30 LDA #$30 -.38584f bb tyx TYX -.385850 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X -.385854 c8 iny INY -.385855 af 01 0f 38 lda $380f01 LDA @lTEMP_STORAGE -.385859 3a dec a DEC A -.38585a 8f 01 0f 38 sta $380f01 STA @lTEMP_STORAGE -.38585e d0 e3 bne $385843 BNE WRITE_CHAR -.385860 60 rts RTS -.385861 DISPLAY_PATTERN -.385861 8b phb PHB -.385862 0b phd PHD -.385863 a9 39 lda #$39 LDA #`PATTERNS -.385865 85 72 sta $72 STA PTRN_ADDR + 2 -.385867 af 18 0f 38 lda $380f18 LDA PATTERN_NUM ; this is a BCD value so it won't work once values are above 9 -.38586b a0 43 07 ldy #$0743 LDY #23*SCREEN_WIDTH + 19 -.38586e 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.385871 3a dec a DEC A ; use 0 based offsets -.385872 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.385876 9c 01 01 stz $0101 STZ UNSIGNED_MULT_A + 1 -.385879 c2 20 rep #$20 REP #$20 ; set A long -.38587b a9 01 07 lda #$0701 LDA #PATTERN_BYTES ; this is the pattern size -.38587e 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.385882 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.385886 1a inc a INC A ; skip the pattern # byte -.385887 85 70 sta $70 STA PTRN_ADDR -.385889 e2 20 sep #$20 SEP #$20 ; set A short -.38588b af 19 0f 38 lda $380f19 LDA LINE_NUM_DEC -.38588f a0 37 07 ldy #$0737 LDY #23*SCREEN_WIDTH + 7 -.385892 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.385895 a9 20 lda #$20 LDA #32 -.385897 85 6e sta $6e STA REM_LINES -.385899 a0 c0 a8 ldy #$a8c0 LDY #<>CS_TEXT_MEM_PTR + SCREEN_WIDTH * 28 ; top of the pattern display -.38589c a5 6c lda $6c LDA LINE_NUM_HEX -.38589e c9 0a cmp #$0a CMP #10 -.3858a0 b0 2f bcs $3858d1 BCS DRAW_DATA ; if line# is greater than 10, skip blank lines and topline -.3858a2 DRAW_BLANK_LINES -.3858a2 38 sec SEC -.3858a3 a9 09 lda #$09 LDA #9 -.3858a5 e5 6c sbc $6c SBC LINE_NUM_HEX -.3858a7 f0 15 beq $3858be BEQ DRAW_TOP_LINE -.3858a9 85 6d sta $6d STA TAB_COUNTER -.3858ab BLANKS_LOOP -.3858ab c2 20 rep #$20 REP #$20 ; set A long -.3858ad a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 -.3858b0 a2 40 44 ldx #$4440 LDX #<>blank_line -.3858b3 54 af 38 mvn $38,$af MVN #`blank_line,#$AF -.3858b6 e2 20 sep #$20 SEP #$20 ; set A short -.3858b8 c6 6e dec $6e DEC REM_LINES -.3858ba c6 6d dec $6d DEC TAB_COUNTER -.3858bc d0 ed bne $3858ab BNE BLANKS_LOOP -.3858be DRAW_TOP_LINE -.3858be c2 20 rep #$20 REP #$20 ; set A long -.3858c0 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 -.3858c3 a2 50 43 ldx #$4350 LDX #<>top_line -.3858c6 54 af 38 mvn $38,$af MVN #`top_line,#$AF -.3858c9 e2 20 sep #$20 SEP #$20 ; set A short -.3858cb c6 6e dec $6e DEC REM_LINES -.3858cd a9 01 lda #$01 LDA #1 -.3858cf 80 05 bra $3858d6 BRA MOD_TOP_LINE -.3858d1 DRAW_DATA -.3858d1 38 sec SEC -.3858d2 a5 6c lda $6c LDA LINE_NUM_HEX -.3858d4 e9 09 sbc #$09 SBC #9 -.3858d6 MOD_TOP_LINE -.3858d6 85 6d sta $6d STA TAB_COUNTER -.3858d8 TRIPLET -.3858d8 a9 00 lda #$00 LDA #0 -.3858da 48 pha PHA -.3858db ab plb PLB -.3858dc a9 1c lda #$1c LDA #LINE_BYTES -.3858de 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.3858e2 9c 01 01 stz $0101 STZ UNSIGNED_MULT_A + 1 -.3858e5 9c 03 01 stz $0103 STZ UNSIGNED_MULT_B + 1 -.3858e8 a5 6d lda $6d LDA TAB_COUNTER -.3858ea 3a dec a DEC A ; use zero based offset -.3858eb 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.3858ef c2 20 rep #$20 REP #$20 ; set A long -.3858f1 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.3858f5 85 73 sta $73 STA LINE_ADDR -.3858f7 e2 20 sep #$20 SEP #$20 ; set A short -.3858f9 a5 6d lda $6d LDA TAB_COUNTER -.3858fb 29 03 and #$03 AND #3 -.3858fd f0 15 beq $385914 BEQ draw_tick_line -.3858ff c2 20 rep #$20 REP #$20 ; set A long -.385901 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 -.385904 a2 e0 44 ldx #$44e0 LDX #<>untick_line -.385907 54 af 38 mvn $38,$af MVN #`untick_line,#$AF -.38590a e2 20 sep #$20 SEP #$20 ; set A short -.38590c 20 93 59 jsr $385993 JSR DRAW_LINE_DATA -.38590f c6 6e dec $6e DEC REM_LINES -.385911 4c 26 59 jmp $385926 JMP next_line -.385914 draw_tick_line -.385914 c2 20 rep #$20 REP #$20 ; set A long -.385916 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 -.385919 a2 90 44 ldx #$4490 LDX #<>tick_line -.38591c 54 af 38 mvn $38,$af MVN #`tick_line,#$AF -.38591f e2 20 sep #$20 SEP #$20 ; set A short -.385921 20 93 59 jsr $385993 JSR DRAW_LINE_DATA -.385924 c6 6e dec $6e DEC REM_LINES -.385926 next_line -.385926 e6 6d inc $6d INC TAB_COUNTER -.385928 a5 6d lda $6d LDA TAB_COUNTER -.38592a c9 41 cmp #$41 CMP #65 -.38592c f0 06 beq $385934 BEQ DRAW_BOTTOM_BAR -.38592e a5 6e lda $6e LDA REM_LINES -.385930 d0 a6 bne $3858d8 BNE TRIPLET -.385932 f0 22 beq $385956 BEQ DRAW_LINE_DONE -.385934 DRAW_BOTTOM_BAR -.385934 c2 20 rep #$20 REP #$20 ; set A long -.385936 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 -.385939 a2 f0 43 ldx #$43f0 LDX #<>btm_line -.38593c 54 af 38 mvn $38,$af MVN #`btm_line,#$AF -.38593f e2 20 sep #$20 SEP #$20 ; set A short -.385941 a5 6e lda $6e LDA REM_LINES -.385943 f0 11 beq $385956 BEQ DRAW_LINE_DONE -.385945 BLANKS_BTM_LOOP -.385945 c2 20 rep #$20 REP #$20 ; set A long -.385947 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 -.38594a a2 40 44 ldx #$4440 LDX #<>blank_line -.38594d 54 af 38 mvn $38,$af MVN #`blank_line,#$AF -.385950 e2 20 sep #$20 SEP #$20 ; set A short -.385952 c6 6e dec $6e DEC REM_LINES -.385954 d0 ef bne $385945 BNE BLANKS_BTM_LOOP -.385956 DRAW_LINE_DONE -.385956 2b pld PLD -.385957 ab plb PLB -.385958 60 rts RTS -.385959 DISPLAY_FILENAME -.385959 a0 00 00 ldy #$0000 LDY #0 -.38595c a2 63 07 ldx #$0763 LDX #23*SCREEN_WIDTH + 51 -.38595f DF_LOOP -.38595f b7 51 lda [$51],y LDA [SDOS_FILE_REC_PTR],Y +.3856db a9 00 lda #$00 LDA #0 +.3856dd 8f 08 00 af sta $af0008 STA BORDER_X_SIZE +.3856e1 8f 09 00 af sta $af0009 STA BORDER_Y_SIZE +.3856e5 e2 20 sep #$20 SEP #$20 ; set A short +.3856e7 a9 20 lda #$20 LDA #$20 +.3856e9 8f 05 00 af sta $af0005 STA BORDER_COLOR_B +.3856ed 8f 07 00 af sta $af0007 STA BORDER_COLOR_R +.3856f1 a9 00 lda #$00 LDA #0 +.3856f3 8f 06 00 af sta $af0006 STA BORDER_COLOR_G +.3856f7 8f 04 00 af sta $af0004 STA BORDER_CTRL_REG +.3856fb 8f 01 00 af sta $af0001 STA MASTER_CTRL_REG_H +.3856ff a9 01 lda #$01 LDA #Mstr_Ctrl_Text_Mode_En +.385701 8f 00 00 af sta $af0000 STA MASTER_CTRL_REG_L +.385705 c2 20 rep #$20 REP #$20 ; set A long +.385707 a9 00 a0 lda #$a000 LDA #<>CS_TEXT_MEM_PTR ; store the initial screen buffer location +.38570a 85 0c sta $0c STA SCREENBEGIN +.38570c 85 17 sta $17 STA CURSORPOS +.38570e e2 20 sep #$20 SEP #$20 ; set A short +.385710 a9 af lda #$af LDA #`CS_TEXT_MEM_PTR +.385712 85 0e sta $0e STA SCREENBEGIN+2 +.385714 85 19 sta $19 STA CURSORPOS+2 +.385716 c2 30 rep #$30 REP #$30 ; set A&X long +.385718 a9 bf 08 lda #$08bf LDA #SCREEN_WIDTH*28-1 +.38571b a2 80 3b ldx #$3b80 LDX #<>TRACKER_SCREEN +.38571e a0 00 a0 ldy #$a000 LDY #<>CS_TEXT_MEM_PTR +.385721 54 af 38 mvn #$38,#$af MVN #`TRACKER_SCREEN,#$AF +.385724 a9 00 08 lda #$0800 LDA #256 * 8 +.385727 a2 80 45 ldx #$4580 LDX #<>FNXFONT +.38572a a0 00 80 ldy #$8000 LDY #<>FONT_MEMORY_BANK0 +.38572d 54 af 38 mvn #$38,#$af MVN #`FNXFONT,#$AF +.385730 a9 ff 60 lda #$60ff LDA #$60FF +.385733 8f 48 1f af sta $af1f48 STA FG_CHAR_LUT_PTR + 8; +.385737 8f 88 1f af sta $af1f88 STA BG_CHAR_LUT_PTR + 8; +.38573b a9 80 00 lda #$0080 LDA #$0080 +.38573e 8f 4a 1f af sta $af1f4a STA FG_CHAR_LUT_PTR + 10; +.385742 8f 8a 1f af sta $af1f8a STA BG_CHAR_LUT_PTR + 10; +.385746 a9 20 80 lda #$8020 LDA #$8020 +.385749 8f 4c 1f af sta $af1f4c STA FG_CHAR_LUT_PTR + 12; +.38574d 8f 8c 1f af sta $af1f8c STA BG_CHAR_LUT_PTR + 12; +.385751 a9 10 00 lda #$0010 LDA #$0010 +.385754 8f 4e 1f af sta $af1f4e STA FG_CHAR_LUT_PTR + 14; +.385758 8f 8e 1f af sta $af1f8e STA BG_CHAR_LUT_PTR + 14; +.38575c a9 cc cc lda #$cccc LDA #$CCCC +.38575f 8f 50 1f af sta $af1f50 STA FG_CHAR_LUT_PTR + 16; +.385763 8f 90 1f af sta $af1f90 STA BG_CHAR_LUT_PTR + 16; +.385767 a9 cc 00 lda #$00cc LDA #$00CC +.38576a 8f 52 1f af sta $af1f52 STA FG_CHAR_LUT_PTR + 18; +.38576e 8f 92 1f af sta $af1f92 STA BG_CHAR_LUT_PTR + 18; +.385772 a9 22 dd lda #$dd22 LDA #$DD22 +.385775 8f 54 1f af sta $af1f54 STA FG_CHAR_LUT_PTR + 20; +.385779 8f 94 1f af sta $af1f94 STA BG_CHAR_LUT_PTR + 20; +.38577d a9 dd 00 lda #$00dd LDA #$00DD +.385780 8f 56 1f af sta $af1f56 STA FG_CHAR_LUT_PTR + 22; +.385784 8f 96 1f af sta $af1f96 STA BG_CHAR_LUT_PTR + 22; +.385788 a2 00 14 ldx #$1400 LDX #SCREEN_WIDTH*64 +.38578b e2 20 sep #$20 SEP #$20 ; set A short +.38578d a9 20 lda #$20 LDA #$20 +.38578f SETTEXTCOLOR +.38578f 9f ff bf af sta $afbfff,x STA CS_COLOR_MEM_PTR-1,X +.385793 ca dex DEX +.385794 d0 f9 bne $38578f BNE SETTEXTCOLOR +.385796 a0 e0 0b ldy #$0be0 LDY #38 * SCREEN_WIDTH +.385799 20 6b 5a jsr $385a6b JSR REVERSE_LUT +.38579c 20 c8 5a jsr $385ac8 JSR HIGHLIGHT_MODE +.38579f 20 5f 5b jsr $385b5f JSR DISPLAY_ACTIVE_CHANNELS +.3857a2 60 rts RTS +.3857a3 WRITE_HEX +.3857a3 48 pha PHA +.3857a4 da phx PHX +.3857a5 5a phy PHY +.3857a6 8f 01 0f 38 sta $380f01 STA @lTEMP_STORAGE +.3857aa 29 f0 and #$f0 AND #$F0 +.3857ac 4a lsr a lsr A +.3857ad 4a lsr a lsr A +.3857ae 4a lsr a lsr A +.3857af 4a lsr a lsr A +.3857b0 e2 10 sep #$10 SEP #$10 ; set X short +.3857b2 aa tax TAX +.3857b3 bf 05 0f 38 lda $380f05,x LDA HEX_MAP,X +.3857b7 8f 03 0f 38 sta $380f03 STA @lLOW_NIBBLE +.3857bb af 01 0f 38 lda $380f01 LDA @lTEMP_STORAGE +.3857bf 29 0f and #$0f AND #$0F +.3857c1 aa tax TAX +.3857c2 bf 05 0f 38 lda $380f05,x LDA HEX_MAP,X +.3857c6 8f 04 0f 38 sta $380f04 STA @lHIGH_NIBBLE +.3857ca c2 30 rep #$30 REP #$30 ; set A&X long +.3857cc 7a ply PLY +.3857cd af 03 0f 38 lda $380f03 LDA @lLOW_NIBBLE +.3857d1 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.3857d3 a9 30 30 lda #$3030 LDA #$3030 +.3857d6 bb tyx TYX +.3857d7 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.3857db e2 20 sep #$20 SEP #$20 ; set A short +.3857dd fa plx PLX +.3857de 68 pla PLA +.3857df 60 rts RTS +.3857e0 WRITE_OFF_ON +.3857e0 da phx PHX +.3857e1 c9 00 cmp #$00 CMP #0 +.3857e3 f0 25 beq $38580a BEQ DISPLAY_OFF +.3857e5 a9 4f lda #$4f LDA #'O' +.3857e7 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.3857e9 a9 30 lda #$30 LDA #$30 +.3857eb bb tyx TYX +.3857ec 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.3857f0 c8 iny INY +.3857f1 a9 6e lda #$6e LDA #'n' +.3857f3 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.3857f5 a9 30 lda #$30 LDA #$30 +.3857f7 bb tyx TYX +.3857f8 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.3857fc c8 iny INY +.3857fd a9 20 lda #$20 LDA #$20 +.3857ff 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385801 a9 30 lda #$30 LDA #$30 +.385803 bb tyx TYX +.385804 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.385808 80 23 bra $38582d BRA ON_OFF_DONE +.38580a DISPLAY_OFF +.38580a a9 4f lda #$4f LDA #'O' +.38580c 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.38580e a9 30 lda #$30 LDA #$30 +.385810 bb tyx TYX +.385811 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.385815 c8 iny INY +.385816 a9 66 lda #$66 LDA #'f' +.385818 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.38581a a9 30 lda #$30 LDA #$30 +.38581c bb tyx TYX +.38581d 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.385821 c8 iny INY +.385822 a9 66 lda #$66 LDA #'f' +.385824 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385826 a9 30 lda #$30 LDA #$30 +.385828 bb tyx TYX +.385829 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.38582d ON_OFF_DONE +.38582d fa plx PLX +.38582e 60 rts RTS +.38582f WRITE_INSTRUMENT_NAME +.38582f a9 0a lda #$0a LDA #10 +.385831 8f 01 0f 38 sta $380f01 STA @lTEMP_STORAGE +.385835 WRITE_CHAR +.385835 a7 67 lda [$67] LDA [INSTR_ADDR] +.385837 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385839 e6 67 inc $67 INC INSTR_ADDR +.38583b d0 02 bne $38583f BNE WRITE_CONTINUE +.38583d e6 68 inc $68 INC INSTR_ADDR + 1 +.38583f WRITE_CONTINUE +.38583f a9 30 lda #$30 LDA #$30 +.385841 bb tyx TYX +.385842 9f 00 c0 af sta $afc000,x STA @lCS_COLOR_MEM_PTR, X +.385846 c8 iny INY +.385847 af 01 0f 38 lda $380f01 LDA @lTEMP_STORAGE +.38584b 3a dec a DEC A +.38584c 8f 01 0f 38 sta $380f01 STA @lTEMP_STORAGE +.385850 d0 e3 bne $385835 BNE WRITE_CHAR +.385852 60 rts RTS +.385853 DISPLAY_PATTERN +.385853 8b phb PHB +.385854 0b phd PHD +.385855 a9 39 lda #$39 LDA #`PATTERNS +.385857 85 72 sta $72 STA PTRN_ADDR + 2 +.385859 af 18 0f 38 lda $380f18 LDA PATTERN_NUM ; this is a BCD value so it won't work once values are above 9 +.38585d a0 43 07 ldy #$0743 LDY #23*SCREEN_WIDTH + 19 +.385860 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.385863 3a dec a DEC A ; use 0 based offsets +.385864 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.385868 9c 01 01 stz $0101 STZ UNSIGNED_MULT_A + 1 +.38586b c2 20 rep #$20 REP #$20 ; set A long +.38586d a9 01 07 lda #$0701 LDA #PATTERN_BYTES ; this is the pattern size +.385870 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.385874 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.385878 1a inc a INC A ; skip the pattern # byte +.385879 85 70 sta $70 STA PTRN_ADDR +.38587b e2 20 sep #$20 SEP #$20 ; set A short +.38587d af 19 0f 38 lda $380f19 LDA LINE_NUM_DEC +.385881 a0 37 07 ldy #$0737 LDY #23*SCREEN_WIDTH + 7 +.385884 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.385887 a9 20 lda #$20 LDA #32 +.385889 85 6e sta $6e STA REM_LINES +.38588b a0 c0 a8 ldy #$a8c0 LDY #<>CS_TEXT_MEM_PTR + SCREEN_WIDTH * 28 ; top of the pattern display +.38588e a5 6c lda $6c LDA LINE_NUM_HEX +.385890 c9 0a cmp #$0a CMP #10 +.385892 b0 2f bcs $3858c3 BCS DRAW_DATA ; if line# is greater than 10, skip blank lines and topline +.385894 DRAW_BLANK_LINES +.385894 38 sec SEC +.385895 a9 09 lda #$09 LDA #9 +.385897 e5 6c sbc $6c SBC LINE_NUM_HEX +.385899 f0 15 beq $3858b0 BEQ DRAW_TOP_LINE +.38589b 85 6d sta $6d STA TAB_COUNTER +.38589d BLANKS_LOOP +.38589d c2 20 rep #$20 REP #$20 ; set A long +.38589f a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 +.3858a2 a2 40 44 ldx #$4440 LDX #<>blank_line +.3858a5 54 af 38 mvn #$38,#$af MVN #`blank_line,#$AF +.3858a8 e2 20 sep #$20 SEP #$20 ; set A short +.3858aa c6 6e dec $6e DEC REM_LINES +.3858ac c6 6d dec $6d DEC TAB_COUNTER +.3858ae d0 ed bne $38589d BNE BLANKS_LOOP +.3858b0 DRAW_TOP_LINE +.3858b0 c2 20 rep #$20 REP #$20 ; set A long +.3858b2 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 +.3858b5 a2 50 43 ldx #$4350 LDX #<>top_line +.3858b8 54 af 38 mvn #$38,#$af MVN #`top_line,#$AF +.3858bb e2 20 sep #$20 SEP #$20 ; set A short +.3858bd c6 6e dec $6e DEC REM_LINES +.3858bf a9 01 lda #$01 LDA #1 +.3858c1 80 05 bra $3858c8 BRA MOD_TOP_LINE +.3858c3 DRAW_DATA +.3858c3 38 sec SEC +.3858c4 a5 6c lda $6c LDA LINE_NUM_HEX +.3858c6 e9 09 sbc #$09 SBC #9 +.3858c8 MOD_TOP_LINE +.3858c8 85 6d sta $6d STA TAB_COUNTER +.3858ca TRIPLET +.3858ca a9 00 lda #$00 LDA #0 +.3858cc 48 pha PHA +.3858cd ab plb PLB +.3858ce a9 1c lda #$1c LDA #LINE_BYTES +.3858d0 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.3858d4 9c 01 01 stz $0101 STZ UNSIGNED_MULT_A + 1 +.3858d7 9c 03 01 stz $0103 STZ UNSIGNED_MULT_B + 1 +.3858da a5 6d lda $6d LDA TAB_COUNTER +.3858dc 3a dec a DEC A ; use zero based offset +.3858dd 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.3858e1 c2 20 rep #$20 REP #$20 ; set A long +.3858e3 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.3858e7 85 73 sta $73 STA LINE_ADDR +.3858e9 e2 20 sep #$20 SEP #$20 ; set A short +.3858eb a5 6d lda $6d LDA TAB_COUNTER +.3858ed 29 03 and #$03 AND #3 +.3858ef f0 15 beq $385906 BEQ draw_tick_line +.3858f1 c2 20 rep #$20 REP #$20 ; set A long +.3858f3 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 +.3858f6 a2 e0 44 ldx #$44e0 LDX #<>untick_line +.3858f9 54 af 38 mvn #$38,#$af MVN #`untick_line,#$AF +.3858fc e2 20 sep #$20 SEP #$20 ; set A short +.3858fe 20 85 59 jsr $385985 JSR DRAW_LINE_DATA +.385901 c6 6e dec $6e DEC REM_LINES +.385903 4c 18 59 jmp $385918 JMP next_line +.385906 draw_tick_line +.385906 c2 20 rep #$20 REP #$20 ; set A long +.385908 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 +.38590b a2 90 44 ldx #$4490 LDX #<>tick_line +.38590e 54 af 38 mvn #$38,#$af MVN #`tick_line,#$AF +.385911 e2 20 sep #$20 SEP #$20 ; set A short +.385913 20 85 59 jsr $385985 JSR DRAW_LINE_DATA +.385916 c6 6e dec $6e DEC REM_LINES +.385918 next_line +.385918 e6 6d inc $6d INC TAB_COUNTER +.38591a a5 6d lda $6d LDA TAB_COUNTER +.38591c c9 41 cmp #$41 CMP #MUSICAL_LINES_PER_BAR + 1 +.38591e f0 06 beq $385926 BEQ DRAW_BOTTOM_BAR +.385920 a5 6e lda $6e LDA REM_LINES +.385922 d0 a6 bne $3858ca BNE TRIPLET +.385924 f0 22 beq $385948 BEQ DRAW_LINE_DONE +.385926 DRAW_BOTTOM_BAR +.385926 c2 20 rep #$20 REP #$20 ; set A long +.385928 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 +.38592b a2 f0 43 ldx #$43f0 LDX #<>btm_line +.38592e 54 af 38 mvn #$38,#$af MVN #`btm_line,#$AF +.385931 e2 20 sep #$20 SEP #$20 ; set A short +.385933 a5 6e lda $6e LDA REM_LINES +.385935 f0 11 beq $385948 BEQ DRAW_LINE_DONE +.385937 BLANKS_BTM_LOOP +.385937 c2 20 rep #$20 REP #$20 ; set A long +.385939 a9 4f 00 lda #$004f LDA #SCREEN_WIDTH-1 +.38593c a2 40 44 ldx #$4440 LDX #<>blank_line +.38593f 54 af 38 mvn #$38,#$af MVN #`blank_line,#$AF +.385942 e2 20 sep #$20 SEP #$20 ; set A short +.385944 c6 6e dec $6e DEC REM_LINES +.385946 d0 ef bne $385937 BNE BLANKS_BTM_LOOP +.385948 DRAW_LINE_DONE +.385948 2b pld PLD +.385949 ab plb PLB +.38594a 60 rts RTS +.38594b DISPLAY_FILENAME +.38594b a0 00 00 ldy #$0000 LDY #0 +.38594e a2 63 07 ldx #$0763 LDX #23*SCREEN_WIDTH + 51 +.385951 DF_LOOP +.385951 b7 51 lda [$51],y LDA [SDOS_FILE_REC_PTR],Y +.385953 5a phy PHY +.385954 9b txy TXY +.385955 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385957 e8 inx INX +.385958 7a ply PLY +.385959 c8 iny INY +.38595a c0 08 00 cpy #$0008 CPY #8 +.38595d d0 08 bne $385967 BNE DF_NOT_DOT +.38595f a9 2e lda #$2e LDA #'.' .385961 5a phy PHY .385962 9b txy TXY .385963 97 0c sta [$0c],y STA [SCREENBEGIN], Y .385965 e8 inx INX .385966 7a ply PLY -.385967 c8 iny INY -.385968 c0 08 00 cpy #$0008 CPY #8 -.38596b d0 08 bne $385975 BNE DF_NOT_DOT -.38596d a9 2e lda #$2e LDA #'.' -.38596f 5a phy PHY -.385970 9b txy TXY +.385967 DF_NOT_DOT +.385967 c0 0b 00 cpy #$000b CPY #11 +.38596a d0 e5 bne $385951 BNE DF_LOOP +.38596c 9b txy TXY +.38596d c8 iny INY +.38596e c8 iny INY +.38596f a9 76 lda #$76 LDA #'v' .385971 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385973 e8 inx INX -.385974 7a ply PLY -.385975 DF_NOT_DOT -.385975 c0 0b 00 cpy #$000b CPY #11 -.385978 d0 e5 bne $38595f BNE DF_LOOP -.38597a 9b txy TXY -.38597b c8 iny INY -.38597c c8 iny INY -.38597d a9 76 lda #$76 LDA #'v' -.38597f 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385981 c8 iny INY -.385982 af 67 6a 38 lda $386a67 LDA @lTuneInfo.version -.385986 89 02 bit #$02 BIT #2 -.385988 d0 04 bne $38598e BNE DF_V2 -.38598a a9 31 lda #$31 LDA #'1' -.38598c 80 02 bra $385990 BRA DF_DONE -.38598e DF_V2 -.38598e a9 32 lda #$32 LDA #'2' -.385990 DF_DONE -.385990 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385992 60 rts RTS -.385993 DRAW_LINE_DATA -.385993 5a phy PHY -.385994 da phx PHX -.385995 a9 09 lda #$09 LDA #9 ; number of channels to populate -.385997 85 f7 sta $f7 STA RAD_CHANNEL -.385999 c2 20 rep #$20 REP #$20 ; set A long -.38599b 98 tya TYA ; copy Y into A -.38599c 38 sec SEC -.38599d e9 50 a0 sbc #$a050 SBC #$A000 + SCREEN_WIDTH -.3859a0 aa tax TAX -.3859a1 e2 20 sep #$20 SEP #$20 ; set A short -.3859a3 a4 73 ldy $73 LDY LINE_ADDR -.3859a5 c8 iny INY ; skip the line number -.3859a6 NEXT_CHANNEL -.3859a6 64 4e stz $4e STZ RAD_TEMP -.3859a8 b7 70 lda [$70],y LDA [PTRN_ADDR],Y ; note/octave -.3859aa e8 inx INX ; skip the first column -.3859ab c8 iny INY -.3859ac c9 00 cmp #$00 CMP #0 -.3859ae d0 04 bne $3859b4 BNE DL_DRAW_NOTE -.3859b0 e8 inx INX -.3859b1 e8 inx INX -.3859b2 80 03 bra $3859b7 BRA DL_SKIP_NOTE_DISPLAY -.3859b4 DL_DRAW_NOTE -.3859b4 20 55 5a jsr $385a55 JSR DISPLAY_NOTE_OCTAVE -.3859b7 DL_SKIP_NOTE_DISPLAY -.3859b7 2a rol a ROL A ; put bit 7 into the carry -.3859b8 90 0b bcc $3859c5 BCC SKIP_MID_COL -.3859ba a9 31 lda #$31 LDA #'1' -.3859bc 5a phy PHY -.3859bd 9b txy TXY -.3859be 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.3859c0 7a ply PLY -.3859c1 a9 10 lda #$10 LDA #$10 -.3859c3 85 4e sta $4e STA RAD_TEMP -.3859c5 SKIP_MID_COL -.3859c5 e8 inx INX ; skip the middle column -.3859c6 b7 70 lda [$70],y LDA [PTRN_ADDR],Y ; instrument/effect -.3859c8 c8 iny INY -.3859c9 20 e2 59 jsr $3859e2 JSR DISPLAY_VALUE_SKIP_LOW_NIBBLE_IF_ZERO -.3859cc c9 00 cmp #$00 CMP #0 ; if the effect byte is 0, don't display the next value -.3859ce d0 04 bne $3859d4 BNE SHOW_EFFECT -.3859d0 e8 inx INX -.3859d1 e8 inx INX -.3859d2 80 05 bra $3859d9 BRA DL_SKIP_EFFECT -.3859d4 SHOW_EFFECT -.3859d4 b7 70 lda [$70],y LDA [PTRN_ADDR],Y ; -.3859d6 20 34 5a jsr $385a34 JSR DISPLAY_DEC_VALUE -.3859d9 DL_SKIP_EFFECT -.3859d9 c8 iny INY -.3859da e8 inx INX ; skip the vertical bar -.3859db c6 f7 dec $f7 DEC RAD_CHANNEL -.3859dd d0 c7 bne $3859a6 BNE NEXT_CHANNEL -.3859df fa plx PLX -.3859e0 7a ply PLY -.3859e1 60 rts RTS -.3859e2 DISPLAY_VALUE_SKIP_LOW_NIBBLE_IF_ZERO -.3859e2 5a phy PHY -.3859e3 48 pha PHA -.3859e4 9b txy TXY -.3859e5 a2 00 00 ldx #$0000 LDX #0 -.3859e8 eb xba XBA +.385973 c8 iny INY +.385974 af d2 6a 38 lda $386ad2 LDA @lTuneInfo.version +.385978 89 02 bit #$02 BIT #2 +.38597a d0 04 bne $385980 BNE DF_V2 +.38597c a9 31 lda #$31 LDA #'1' +.38597e 80 02 bra $385982 BRA DF_DONE +.385980 DF_V2 +.385980 a9 32 lda #$32 LDA #'2' +.385982 DF_DONE +.385982 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385984 60 rts RTS +.385985 DRAW_LINE_DATA +.385985 5a phy PHY +.385986 da phx PHX +.385987 a9 09 lda #$09 LDA #9 ; number of channels to populate +.385989 85 f7 sta $f7 STA RAD_CHANNEL +.38598b c2 20 rep #$20 REP #$20 ; set A long +.38598d 98 tya TYA ; copy Y into A +.38598e 38 sec SEC +.38598f e9 50 a0 sbc #$a050 SBC #$A000 + SCREEN_WIDTH +.385992 aa tax TAX +.385993 e2 20 sep #$20 SEP #$20 ; set A short +.385995 a4 73 ldy $73 LDY LINE_ADDR +.385997 c8 iny INY ; skip the line number +.385998 NEXT_CHANNEL +.385998 64 4e stz $4e STZ RAD_TEMP +.38599a b7 70 lda [$70],y LDA [PTRN_ADDR],Y ; note/octave +.38599c e8 inx INX ; skip the first column +.38599d c8 iny INY +.38599e c9 00 cmp #$00 CMP #0 +.3859a0 d0 04 bne $3859a6 BNE DL_DRAW_NOTE +.3859a2 e8 inx INX +.3859a3 e8 inx INX +.3859a4 80 03 bra $3859a9 BRA DL_SKIP_NOTE_DISPLAY +.3859a6 DL_DRAW_NOTE +.3859a6 20 47 5a jsr $385a47 JSR DISPLAY_NOTE_OCTAVE +.3859a9 DL_SKIP_NOTE_DISPLAY +.3859a9 2a rol a ROL A ; put bit 7 into the carry +.3859aa 90 0b bcc $3859b7 BCC SKIP_MID_COL +.3859ac a9 31 lda #$31 LDA #'1' +.3859ae 5a phy PHY +.3859af 9b txy TXY +.3859b0 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.3859b2 7a ply PLY +.3859b3 a9 10 lda #$10 LDA #$10 +.3859b5 85 4e sta $4e STA RAD_TEMP +.3859b7 SKIP_MID_COL +.3859b7 e8 inx INX ; skip the middle column +.3859b8 b7 70 lda [$70],y LDA [PTRN_ADDR],Y ; instrument/effect +.3859ba c8 iny INY +.3859bb 20 d4 59 jsr $3859d4 JSR DISPLAY_VALUE_SKIP_LOW_NIBBLE_IF_ZERO +.3859be c9 00 cmp #$00 CMP #0 ; if the effect byte is 0, don't display the next value +.3859c0 d0 04 bne $3859c6 BNE SHOW_EFFECT +.3859c2 e8 inx INX +.3859c3 e8 inx INX +.3859c4 80 05 bra $3859cb BRA DL_SKIP_EFFECT +.3859c6 SHOW_EFFECT +.3859c6 b7 70 lda [$70],y LDA [PTRN_ADDR],Y ; +.3859c8 20 26 5a jsr $385a26 JSR DISPLAY_DEC_VALUE +.3859cb DL_SKIP_EFFECT +.3859cb c8 iny INY +.3859cc e8 inx INX ; skip the vertical bar +.3859cd c6 f7 dec $f7 DEC RAD_CHANNEL +.3859cf d0 c7 bne $385998 BNE NEXT_CHANNEL +.3859d1 fa plx PLX +.3859d2 7a ply PLY +.3859d3 60 rts RTS +.3859d4 DISPLAY_VALUE_SKIP_LOW_NIBBLE_IF_ZERO +.3859d4 5a phy PHY +.3859d5 48 pha PHA +.3859d6 9b txy TXY +.3859d7 a2 00 00 ldx #$0000 LDX #0 +.3859da eb xba XBA +.3859db a9 00 lda #$00 LDA #0 +.3859dd eb xba XBA +.3859de 29 f0 and #$f0 AND #$F0 ; high-nibble +.3859e0 d0 09 bne $3859eb BNE DV_DISPLAY_VALUE +.3859e2 a5 4e lda $4e LDA RAD_TEMP +.3859e4 d0 03 bne $3859e9 BNE DV_DISPLAY_ZERO +.3859e6 c8 iny INY +.3859e7 80 0e bra $3859f7 BRA DV_LOW_NIBBLE +.3859e9 DV_DISPLAY_ZERO .3859e9 a9 00 lda #$00 LDA #0 -.3859eb eb xba XBA -.3859ec 29 f0 and #$f0 AND #$F0 ; high-nibble -.3859ee d0 09 bne $3859f9 BNE DV_DISPLAY_VALUE -.3859f0 a5 4e lda $4e LDA RAD_TEMP -.3859f2 d0 03 bne $3859f7 BNE DV_DISPLAY_ZERO -.3859f4 c8 iny INY -.3859f5 80 0e bra $385a05 BRA DV_LOW_NIBBLE -.3859f7 DV_DISPLAY_ZERO -.3859f7 a9 00 lda #$00 LDA #0 -.3859f9 DV_DISPLAY_VALUE -.3859f9 4a lsr a LSR -.3859fa 4a lsr a LSR -.3859fb 4a lsr a LSR -.3859fc 4a lsr a LSR -.3859fd aa tax TAX -.3859fe bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X -.385a02 97 0c sta [$0c],y STA [SCREENBEGIN],Y -.385a04 c8 iny INY -.385a05 DV_LOW_NIBBLE -.385a05 68 pla PLA -.385a06 29 0f and #$0f AND #$F ; low-nibble - effect -.385a08 f0 07 beq $385a11 BEQ SKIP_VALUE -.385a0a aa tax TAX -.385a0b bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X -.385a0f 97 0c sta [$0c],y STA [SCREENBEGIN],Y -.385a11 SKIP_VALUE -.385a11 c8 iny INY -.385a12 bb tyx TYX -.385a13 7a ply PLY -.385a14 60 rts RTS -.385a15 DISPLAY_VALUE -.385a15 5a phy PHY -.385a16 48 pha PHA -.385a17 9b txy TXY -.385a18 29 f0 and #$f0 AND #$F0 ; high-nibble -.385a1a 4a lsr a LSR -.385a1b 4a lsr a LSR -.385a1c 4a lsr a LSR -.385a1d 4a lsr a LSR -.385a1e aa tax TAX -.385a1f bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X -.385a23 97 0c sta [$0c],y STA [SCREENBEGIN],Y -.385a25 c8 iny INY -.385a26 68 pla PLA -.385a27 29 0f and #$0f AND #$F ; low-nibble -.385a29 aa tax TAX -.385a2a bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X -.385a2e 97 0c sta [$0c],y STA [SCREENBEGIN],Y -.385a30 c8 iny INY -.385a31 bb tyx TYX -.385a32 7a ply PLY -.385a33 60 rts RTS -.385a34 DISPLAY_DEC_VALUE -.385a34 48 pha PHA -.385a35 29 07 and #$07 AND #$7 -.385a37 85 6f sta $6f STA DEC_MEM -.385a39 68 pla PLA -.385a3a 29 f8 and #$f8 AND #$F8 ; count in BCD in factors of 8 -.385a3c 18 clc CLC -.385a3d 4a lsr a LSR -.385a3e 4a lsr a LSR -.385a3f 4a lsr a LSR -.385a40 85 76 sta $76 STA CONV_VAL -.385a42 f8 sed SED ; switch to decimal mode -.385a43 f0 09 beq $385a4e BEQ ADD_DEC -.385a45 18 clc CLC -.385a46 a9 00 lda #$00 LDA #0 -.385a48 MULT_DEC -.385a48 69 08 adc #$08 ADC #$8 -.385a4a c6 76 dec $76 DEC CONV_VAL -.385a4c d0 fa bne $385a48 BNE MULT_DEC -.385a4e ADD_DEC -.385a4e 65 6f adc $6f ADC DEC_MEM -.385a50 20 15 5a jsr $385a15 JSR DISPLAY_VALUE -.385a53 d8 cld CLD -.385a54 60 rts RTS -.385a55 DISPLAY_NOTE_OCTAVE -.385a55 5a phy PHY -.385a56 48 pha PHA -.385a57 48 pha PHA -.385a58 9b txy TXY -.385a59 c2 20 rep #$20 REP #$20 ; set A long -.385a5b 29 0f 00 and #$000f AND #$F ; low-nibble - C#=1, D=2, ... C=12, 0 is no note and $F is Key Off -.385a5e aa tax TAX -.385a5f e2 20 sep #$20 SEP #$20 ; set A short -.385a61 bf 5a 6a 38 lda $386a5a,x LDA @lnote_array, X -.385a65 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385a67 c8 iny INY +.3859eb DV_DISPLAY_VALUE +.3859eb 4a lsr a LSR +.3859ec 4a lsr a LSR +.3859ed 4a lsr a LSR +.3859ee 4a lsr a LSR +.3859ef aa tax TAX +.3859f0 bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X +.3859f4 97 0c sta [$0c],y STA [SCREENBEGIN],Y +.3859f6 c8 iny INY +.3859f7 DV_LOW_NIBBLE +.3859f7 68 pla PLA +.3859f8 29 0f and #$0f AND #$F ; low-nibble - effect +.3859fa f0 07 beq $385a03 BEQ SKIP_VALUE +.3859fc aa tax TAX +.3859fd bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X +.385a01 97 0c sta [$0c],y STA [SCREENBEGIN],Y +.385a03 SKIP_VALUE +.385a03 c8 iny INY +.385a04 bb tyx TYX +.385a05 7a ply PLY +.385a06 60 rts RTS +.385a07 DISPLAY_VALUE +.385a07 5a phy PHY +.385a08 48 pha PHA +.385a09 9b txy TXY +.385a0a 29 f0 and #$f0 AND #$F0 ; high-nibble +.385a0c 4a lsr a LSR +.385a0d 4a lsr a LSR +.385a0e 4a lsr a LSR +.385a0f 4a lsr a LSR +.385a10 aa tax TAX +.385a11 bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X +.385a15 97 0c sta [$0c],y STA [SCREENBEGIN],Y +.385a17 c8 iny INY +.385a18 68 pla PLA +.385a19 29 0f and #$0f AND #$F ; low-nibble +.385a1b aa tax TAX +.385a1c bf 05 0f 38 lda $380f05,x LDA HEX_MAP, X +.385a20 97 0c sta [$0c],y STA [SCREENBEGIN],Y +.385a22 c8 iny INY +.385a23 bb tyx TYX +.385a24 7a ply PLY +.385a25 60 rts RTS +.385a26 DISPLAY_DEC_VALUE +.385a26 48 pha PHA +.385a27 29 07 and #$07 AND #$7 +.385a29 85 6f sta $6f STA DEC_MEM +.385a2b 68 pla PLA +.385a2c 29 f8 and #$f8 AND #$F8 ; count in BCD in factors of 8 +.385a2e 18 clc CLC +.385a2f 4a lsr a LSR +.385a30 4a lsr a LSR +.385a31 4a lsr a LSR +.385a32 85 76 sta $76 STA CONV_VAL +.385a34 f8 sed SED ; switch to decimal mode +.385a35 f0 09 beq $385a40 BEQ ADD_DEC +.385a37 18 clc CLC +.385a38 a9 00 lda #$00 LDA #0 +.385a3a MULT_DEC +.385a3a 69 08 adc #$08 ADC #$8 +.385a3c c6 76 dec $76 DEC CONV_VAL +.385a3e d0 fa bne $385a3a BNE MULT_DEC +.385a40 ADD_DEC +.385a40 65 6f adc $6f ADC DEC_MEM +.385a42 20 07 5a jsr $385a07 JSR DISPLAY_VALUE +.385a45 d8 cld CLD +.385a46 60 rts RTS +.385a47 DISPLAY_NOTE_OCTAVE +.385a47 5a phy PHY +.385a48 48 pha PHA +.385a49 48 pha PHA +.385a4a 9b txy TXY +.385a4b c2 20 rep #$20 REP #$20 ; set A long +.385a4d 29 0f 00 and #$000f AND #$F ; low-nibble - C#=1, D=2, ... C=12, 0 is no note and $F is Key Off +.385a50 aa tax TAX +.385a51 e2 20 sep #$20 SEP #$20 ; set A short +.385a53 bf c5 6a 38 lda $386ac5,x LDA @lnote_array, X +.385a57 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385a59 c8 iny INY +.385a5a 68 pla PLA +.385a5b 29 70 and #$70 AND #$70 ; high-nibble +.385a5d 4a lsr a LSR +.385a5e 4a lsr a LSR +.385a5f 4a lsr a LSR +.385a60 4a lsr a LSR +.385a61 18 clc CLC +.385a62 69 30 adc #$30 ADC #$30 +.385a64 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385a66 c8 iny INY +.385a67 bb tyx TYX .385a68 68 pla PLA -.385a69 29 70 and #$70 AND #$70 ; high-nibble -.385a6b 4a lsr a LSR -.385a6c 4a lsr a LSR -.385a6d 4a lsr a LSR -.385a6e 4a lsr a LSR -.385a6f 18 clc CLC -.385a70 69 30 adc #$30 ADC #$30 -.385a72 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385a74 c8 iny INY -.385a75 bb tyx TYX -.385a76 68 pla PLA -.385a77 7a ply PLY -.385a78 60 rts RTS -.385a79 REVERSE_LUT -.385a79 8b phb PHB -.385a7a a9 af lda #$af LDA #`CS_COLOR_MEM_PTR -.385a7c 48 pha PHA -.385a7d ab plb PLB -.385a7e a9 09 lda #$09 LDA #9 -.385a80 85 6d sta $6d STA TAB_COUNTER -.385a82 REVERSE_LUT_TABS -.385a82 a9 42 lda #$42 LDA #$42 ; purple background and white foreground +.385a69 7a ply PLY +.385a6a 60 rts RTS +.385a6b REVERSE_LUT +.385a6b 8b phb PHB +.385a6c a9 af lda #$af LDA #`CS_COLOR_MEM_PTR +.385a6e 48 pha PHA +.385a6f ab plb PLB +.385a70 a9 09 lda #$09 LDA #9 +.385a72 85 6d sta $6d STA TAB_COUNTER +.385a74 REVERSE_LUT_TABS +.385a74 a9 42 lda #$42 LDA #$42 ; purple background and white foreground +.385a76 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y +.385a79 c8 iny INY +.385a7a 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y +.385a7d c8 iny INY +.385a7e 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y +.385a81 c8 iny INY +.385a82 a9 52 lda #$52 LDA #$52 ; purple background and yellow foreground .385a84 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y .385a87 c8 iny INY .385a88 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y .385a8b c8 iny INY -.385a8c 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y -.385a8f c8 iny INY -.385a90 a9 52 lda #$52 LDA #$52 ; purple background and yellow foreground +.385a8c a9 42 lda #$42 LDA #$42 ; purple background and white foreground +.385a8e 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y +.385a91 c8 iny INY .385a92 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y .385a95 c8 iny INY .385a96 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y .385a99 c8 iny INY -.385a9a a9 42 lda #$42 LDA #$42 ; purple background and white foreground -.385a9c 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y -.385a9f c8 iny INY -.385aa0 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y -.385aa3 c8 iny INY -.385aa4 99 00 c0 sta $afc000,y STA CS_COLOR_MEM_PTR, Y -.385aa7 c8 iny INY -.385aa8 c8 iny INY ; skip separator -.385aa9 c6 6d dec $6d DEC TAB_COUNTER -.385aab d0 d5 bne $385a82 BNE REVERSE_LUT_TABS -.385aad ab plb PLB -.385aae 60 rts RTS +.385a9a c8 iny INY ; skip separator +.385a9b c6 6d dec $6d DEC TAB_COUNTER +.385a9d d0 d5 bne $385a74 BNE REVERSE_LUT_TABS +.385a9f ab plb PLB +.385aa0 60 rts RTS =406 INSTR_HL_SCR = SCREEN_WIDTH * 5 + 6 =484 INSTR_NUM_HL_SCR = SCREEN_WIDTH * 6 + 4 =453 ORDER_HL_SCR = SCREEN_WIDTH * 5 + 53 =2081 PTTRN_HL_SCR = SCREEN_WIDTH * 26 + 1 -.385aaf DISPLAY_SPEED -.385aaf 5a phy PHY -.385ab0 af 69 6a 38 lda $386a69 LDA @lTuneInfo.InitialSpeed -.385ab4 a0 58 07 ldy #$0758 LDY #23*SCREEN_WIDTH + 40 -.385ab7 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.385aba af 6a 6a 38 lda $386a6a LDA @lTuneInfo.hasSlowTimer -.385abe f0 07 beq $385ac7 BEQ DS_DONE -.385ac0 a9 2a lda #$2a LDA #'*' -.385ac2 a0 57 07 ldy #$0757 LDY #23*SCREEN_WIDTH + 39 -.385ac5 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385ac7 DS_DONE -.385ac7 7a ply PLY -.385ac8 60 rts RTS -.385ac9 DISPLAY_BPM -.385ac9 60 rts RTS -.385aca HL_CLR_TABLE ->385aca 40 20 20 10 .byte $40, $20, $20, $10 ->385ace 20 40 20 30 .byte $20, $40, $20, $30 ->385ad2 20 20 40 20 .byte $20, $20, $40, $20 -.385ad6 HIGHLIGHT_MODE -.385ad6 a9 00 lda #$00 LDA #0 -.385ad8 eb xba XBA -.385ad9 af 15 0f 38 lda $380f15 LDA STATE_MACHINE -.385add 29 30 and #$30 AND #$30 -.385adf 4a lsr a LSR -.385ae0 4a lsr a LSR -.385ae1 48 pha PHA -.385ae2 48 pha PHA -.385ae3 aa tax TAX -.385ae4 bf ca 5a 38 lda $385aca,x LDA HL_CLR_TABLE,X -.385ae8 a2 0a 00 ldx #$000a LDX #10 -.385aeb a0 96 21 ldy #$2196 LDY #$2000 + INSTR_HL_SCR -.385aee INSTR_HIGHLIGHT_LOOP -.385aee 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385af0 c8 iny INY -.385af1 ca dex DEX -.385af2 d0 fa bne $385aee BNE INSTR_HIGHLIGHT_LOOP -.385af4 a0 e4 21 ldy #$21e4 LDY #$2000 + INSTR_NUM_HL_SCR +.385aa1 DISPLAY_SPEED +.385aa1 5a phy PHY +.385aa2 af d4 6a 38 lda $386ad4 LDA @lTuneInfo.InitialSpeed +.385aa6 a0 58 07 ldy #$0758 LDY #23*SCREEN_WIDTH + 40 +.385aa9 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.385aac af d5 6a 38 lda $386ad5 LDA @lTuneInfo.hasSlowTimer +.385ab0 f0 07 beq $385ab9 BEQ DS_DONE +.385ab2 a9 2a lda #$2a LDA #'*' +.385ab4 a0 57 07 ldy #$0757 LDY #23*SCREEN_WIDTH + 39 +.385ab7 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385ab9 DS_DONE +.385ab9 7a ply PLY +.385aba 60 rts RTS +.385abb DISPLAY_BPM +.385abb 60 rts RTS +.385abc HL_CLR_TABLE +>385abc 40 20 20 10 .byte $40, $20, $20, $10 +>385ac0 20 40 20 30 .byte $20, $40, $20, $30 +>385ac4 20 20 40 20 .byte $20, $20, $40, $20 +.385ac8 HIGHLIGHT_MODE +.385ac8 a9 00 lda #$00 LDA #0 +.385aca eb xba XBA +.385acb af 15 0f 38 lda $380f15 LDA STATE_MACHINE +.385acf 29 30 and #$30 AND #$30 +.385ad1 4a lsr a LSR +.385ad2 4a lsr a LSR +.385ad3 48 pha PHA +.385ad4 48 pha PHA +.385ad5 aa tax TAX +.385ad6 bf bc 5a 38 lda $385abc,x LDA HL_CLR_TABLE,X +.385ada a2 0a 00 ldx #$000a LDX #10 +.385add a0 96 21 ldy #$2196 LDY #$2000 + INSTR_HL_SCR +.385ae0 INSTR_HIGHLIGHT_LOOP +.385ae0 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385ae2 c8 iny INY +.385ae3 ca dex DEX +.385ae4 d0 fa bne $385ae0 BNE INSTR_HIGHLIGHT_LOOP +.385ae6 a0 e4 21 ldy #$21e4 LDY #$2000 + INSTR_NUM_HL_SCR +.385ae9 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385aeb 68 pla PLA +.385aec aa tax TAX +.385aed bf bd 5a 38 lda $385abd,x LDA HL_CLR_TABLE+1,X +.385af1 a2 05 00 ldx #$0005 LDX #5 +.385af4 a0 c5 21 ldy #$21c5 LDY #$2000 + ORDER_HL_SCR +.385af7 ORDER_HIGHLIGHT_LOOP .385af7 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385af9 68 pla PLA -.385afa aa tax TAX -.385afb bf cb 5a 38 lda $385acb,x LDA HL_CLR_TABLE+1,X -.385aff a2 05 00 ldx #$0005 LDX #5 -.385b02 a0 c5 21 ldy #$21c5 LDY #$2000 + ORDER_HL_SCR -.385b05 ORDER_HIGHLIGHT_LOOP -.385b05 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385b07 c8 iny INY -.385b08 ca dex DEX -.385b09 d0 fa bne $385b05 BNE ORDER_HIGHLIGHT_LOOP -.385b0b 68 pla PLA -.385b0c aa tax TAX -.385b0d bf cc 5a 38 lda $385acc,x LDA HL_CLR_TABLE+2,X -.385b11 a2 09 00 ldx #$0009 LDX #9 -.385b14 a0 21 28 ldy #$2821 LDY #$2000 + PTTRN_HL_SCR -.385b17 HL_PATTERN_LOOP -.385b17 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385b19 c8 iny INY -.385b1a c8 iny INY -.385b1b c8 iny INY -.385b1c c8 iny INY -.385b1d c8 iny INY -.385b1e 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385b20 c8 iny INY -.385b21 c8 iny INY -.385b22 c8 iny INY -.385b23 c8 iny INY -.385b24 ca dex DEX -.385b25 d0 f0 bne $385b17 BNE HL_PATTERN_LOOP -.385b27 20 6d 5b jsr $385b6d JSR DISPLAY_ACTIVE_CHANNELS -.385b2a 60 rts RTS -.385b2b DISPLAY_ORDERS -.385b2b af 68 6a 38 lda $386a68 LDA @lTuneInfo.songLength -.385b2f f0 3b beq $385b6c BEQ DO_DONE -.385b31 c9 0e cmp #$0e CMP #14 -.385b33 90 02 bcc $385b37 BCC DO_DISPLAY_ORDERS -.385b35 a9 0e lda #$0e LDA #14 ; only display up to 14 orders -.385b37 DO_DISPLAY_ORDERS -.385b37 85 6d sta $6d STA TAB_COUNTER -.385b39 a2 00 00 ldx #$0000 LDX #0 -.385b3c a0 65 02 ldy #$0265 LDY #SCREEN_WIDTH * 7 + 53 -.385b3f c2 20 rep #$20 REP #$20 ; set A long -.385b41 a9 24 fc lda #$fc24 LDA #<>ORDERS -.385b44 85 f0 sta $f0 STA RAD_ADDR -.385b46 a9 39 00 lda #$0039 LDA #<`ORDERS -.385b49 85 f2 sta $f2 STA RAD_ADDR + 2 -.385b4b e2 20 sep #$20 SEP #$20 ; set A short -.385b4d NEXT_ORDER -.385b4d 8a txa TXA -.385b4e 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.385b51 c8 iny INY -.385b52 c8 iny INY -.385b53 c8 iny INY -.385b54 5a phy PHY -.385b55 9b txy TXY -.385b56 b7 f0 lda [$f0],y LDA [RAD_ADDR],Y -.385b58 1a inc a INC A -.385b59 7a ply PLY -.385b5a 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.385b5d e8 inx INX -.385b5e c2 20 rep #$20 REP #$20 ; set A long -.385b60 98 tya TYA -.385b61 18 clc CLC -.385b62 69 4d 00 adc #$004d ADC #SCREEN_WIDTH - 3 -.385b65 a8 tay TAY -.385b66 e2 20 sep #$20 SEP #$20 ; set A short -.385b68 c6 6d dec $6d DEC TAB_COUNTER -.385b6a d0 e1 bne $385b4d BNE NEXT_ORDER -.385b6c DO_DONE -.385b6c 60 rts RTS -.385b6d DISPLAY_ACTIVE_CHANNELS -.385b6d a2 09 00 ldx #$0009 LDX #9 -.385b70 a0 6b 28 ldy #$286b LDY #$2000 + SCREEN_WIDTH * 26 + 75 -.385b73 DAC_LOOP -.385b73 bf b1 68 38 lda $3868b1,x LDA CHANNELS-1,X -.385b77 f0 06 beq $385b7f BEQ INACTIVE_CHANNEL -.385b79 a9 40 lda #$40 LDA #$40 ; white -.385b7b 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385b7d 80 04 bra $385b83 BRA DAC_CONTINUE -.385b7f INACTIVE_CHANNEL -.385b7f a9 20 lda #$20 LDA #$20 ; purple -.385b81 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.385b83 DAC_CONTINUE -.385b83 88 dey DEY -.385b84 88 dey DEY -.385b85 88 dey DEY -.385b86 88 dey DEY -.385b87 88 dey DEY -.385b88 88 dey DEY -.385b89 88 dey DEY -.385b8a 88 dey DEY -.385b8b 88 dey DEY -.385b8c ca dex DEX -.385b8d d0 e4 bne $385b73 BNE DAC_LOOP -.385b8f 60 rts RTS -.385b90 DISPLAY_CHAR -.385b90 5a phy PHY -.385b91 a4 1a ldy $1a LDY CURSORX -.385b93 97 0c sta [$0c],y STA [SCREENBEGIN],Y -.385b95 c8 iny INY -.385b96 84 1a sty $1a STY CURSORX -.385b98 7a ply PLY -.385b99 6b rtl RTL -.385b9a DISPLAY_NEXT_LINE_dep -.385b9a c2 20 rep #$20 REP #$20 ; set A long -.385b9c a5 1a lda $1a LDA CURSORX -.385b9e 29 e0 ff and #$ffe0 AND #$FFE0 ; lines are $0, 80, 160, etc -.385ba1 18 clc CLC -.385ba2 69 6f 00 adc #$006f ADC #SCREEN_WIDTH + 31 ; move to the next line and offset to the file box -.385ba5 85 1a sta $1a STA CURSORX -.385ba7 e2 20 sep #$20 SEP #$20 ; set A short -.385ba9 6b rtl RTL -.385baa DISPLAY_MSG -.385baa 8b phb PHB -.385bab 48 pha PHA ; begin setdbr macro -.385bac 08 php PHP -.385bad e2 20 sep #$20 SEP #$20 ; set A short -.385baf a9 00 lda #$00 LDA #`CS_COLOR_MEM_PTR ; store the initial colour buffer location -.385c2b 85 17 sta $17 STA CURSORPOS -.385c2d ad 1f 03 lda $031f LDA SDOS_LINE_SELECT -.385c30 8d 00 01 sta $0100 STA UNSIGNED_MULT_A -.385c33 a9 50 00 lda #$0050 LDA #SCREEN_WIDTH -.385c36 8d 02 01 sta $0102 STA UNSIGNED_MULT_B -.385c39 ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT -.385c3c 18 clc CLC -.385c3d 69 8f 03 adc #$038f ADC #SCREEN_WIDTH * 11 + 31 -.385c40 a8 tay TAY -.385c41 e2 20 sep #$20 SEP #$20 ; set A short -.385c43 a9 af lda #$af LDA #`CS_TEXT_MEM_PTR -.385c45 85 19 sta $19 STA CURSORPOS+2 -.385c47 a2 12 00 ldx #$0012 LDX #18 -.385c4a 68 pla PLA -.385c4b HS_LOOP -.385c4b 97 17 sta [$17],y STA [CURSORPOS],Y -.385c4d c8 iny INY -.385c4e ca dex DEX -.385c4f d0 fa bne $385c4b BNE HS_LOOP -.385c51 6b rtl RTL -.385c52 SELECT_NEXT_FILE -.385c52 18 clc CLC -.385c53 ad 1f 03 lda $031f LDA SDOS_LINE_SELECT -.385c56 1a inc a INC A -.385c57 c9 26 cmp #$26 CMP #38 -.385c59 b0 0f bcs $385c6a BCS DO_NOT_SELECT -.385c5b a9 50 lda #$50 LDA #$50 ; black background -.385c5d 22 25 5c 38 jsl $385c25 JSL TEXT_COLOUR_SELECTED -.385c61 ee 1f 03 inc $031f INC SDOS_LINE_SELECT -.385c64 a9 05 lda #$05 LDA #5 ; yellow background -.385c66 22 25 5c 38 jsl $385c25 JSL TEXT_COLOUR_SELECTED -.385c6a DO_NOT_SELECT -.385c6a 6b rtl RTL -.385c6b SELECT_PREVIOUS_FILE -.385c6b 18 clc CLC -.385c6c ad 1f 03 lda $031f LDA SDOS_LINE_SELECT -.385c6f 3a dec a DEC A -.385c70 30 f8 bmi $385c6a BMI DO_NOT_SELECT -.385c72 a9 50 lda #$50 LDA #$50 ; black background -.385c74 22 25 5c 38 jsl $385c25 JSL TEXT_COLOUR_SELECTED -.385c78 ce 1f 03 dec $031f DEC SDOS_LINE_SELECT -.385c7b a9 05 lda #$05 LDA #5 ; yellow background -.385c7d 22 25 5c 38 jsl $385c25 JSL TEXT_COLOUR_SELECTED -.385c81 6b rtl RTL +.385af9 c8 iny INY +.385afa ca dex DEX +.385afb d0 fa bne $385af7 BNE ORDER_HIGHLIGHT_LOOP +.385afd 68 pla PLA +.385afe aa tax TAX +.385aff bf be 5a 38 lda $385abe,x LDA HL_CLR_TABLE+2,X +.385b03 a2 09 00 ldx #$0009 LDX #9 +.385b06 a0 21 28 ldy #$2821 LDY #$2000 + PTTRN_HL_SCR +.385b09 HL_PATTERN_LOOP +.385b09 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385b0b c8 iny INY +.385b0c c8 iny INY +.385b0d c8 iny INY +.385b0e c8 iny INY +.385b0f c8 iny INY +.385b10 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385b12 c8 iny INY +.385b13 c8 iny INY +.385b14 c8 iny INY +.385b15 c8 iny INY +.385b16 ca dex DEX +.385b17 d0 f0 bne $385b09 BNE HL_PATTERN_LOOP +.385b19 20 5f 5b jsr $385b5f JSR DISPLAY_ACTIVE_CHANNELS +.385b1c 60 rts RTS +.385b1d DISPLAY_ORDERS +.385b1d af d3 6a 38 lda $386ad3 LDA @lTuneInfo.songLength +.385b21 f0 3b beq $385b5e BEQ DO_DONE +.385b23 c9 0e cmp #$0e CMP #14 +.385b25 90 02 bcc $385b29 BCC DO_DISPLAY_ORDERS +.385b27 a9 0e lda #$0e LDA #14 ; only display up to 14 orders +.385b29 DO_DISPLAY_ORDERS +.385b29 85 6d sta $6d STA TAB_COUNTER +.385b2b a2 00 00 ldx #$0000 LDX #0 +.385b2e a0 65 02 ldy #$0265 LDY #SCREEN_WIDTH * 7 + 53 +.385b31 c2 20 rep #$20 REP #$20 ; set A long +.385b33 a9 24 fc lda #$fc24 LDA #<>ORDERS +.385b36 85 f0 sta $f0 STA RAD_ADDR +.385b38 a9 39 00 lda #$0039 LDA #<`ORDERS +.385b3b 85 f2 sta $f2 STA RAD_ADDR + 2 +.385b3d e2 20 sep #$20 SEP #$20 ; set A short +.385b3f NEXT_ORDER +.385b3f 8a txa TXA +.385b40 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.385b43 c8 iny INY +.385b44 c8 iny INY +.385b45 c8 iny INY +.385b46 5a phy PHY +.385b47 9b txy TXY +.385b48 b7 f0 lda [$f0],y LDA [RAD_ADDR],Y +.385b4a 1a inc a INC A +.385b4b 7a ply PLY +.385b4c 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.385b4f e8 inx INX +.385b50 c2 20 rep #$20 REP #$20 ; set A long +.385b52 98 tya TYA +.385b53 18 clc CLC +.385b54 69 4d 00 adc #$004d ADC #SCREEN_WIDTH - 3 +.385b57 a8 tay TAY +.385b58 e2 20 sep #$20 SEP #$20 ; set A short +.385b5a c6 6d dec $6d DEC TAB_COUNTER +.385b5c d0 e1 bne $385b3f BNE NEXT_ORDER +.385b5e DO_DONE +.385b5e 60 rts RTS +.385b5f DISPLAY_ACTIVE_CHANNELS +.385b5f a2 09 00 ldx #$0009 LDX #9 +.385b62 a0 6b 28 ldy #$286b LDY #$2000 + SCREEN_WIDTH * 26 + 75 +.385b65 DAC_LOOP +.385b65 bf 1c 69 38 lda $38691c,x LDA CHANNELS-1,X +.385b69 f0 06 beq $385b71 BEQ INACTIVE_CHANNEL +.385b6b a9 40 lda #$40 LDA #$40 ; white +.385b6d 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385b6f 80 04 bra $385b75 BRA DAC_CONTINUE +.385b71 INACTIVE_CHANNEL +.385b71 a9 20 lda #$20 LDA #$20 ; purple +.385b73 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.385b75 DAC_CONTINUE +.385b75 88 dey DEY +.385b76 88 dey DEY +.385b77 88 dey DEY +.385b78 88 dey DEY +.385b79 88 dey DEY +.385b7a 88 dey DEY +.385b7b 88 dey DEY +.385b7c 88 dey DEY +.385b7d 88 dey DEY +.385b7e ca dex DEX +.385b7f d0 e4 bne $385b65 BNE DAC_LOOP +.385b81 60 rts RTS +.385b82 DISPLAY_CHAR +.385b82 5a phy PHY +.385b83 a4 1a ldy $1a LDY CURSORX +.385b85 97 0c sta [$0c],y STA [SCREENBEGIN],Y +.385b87 c8 iny INY +.385b88 84 1a sty $1a STY CURSORX +.385b8a 7a ply PLY +.385b8b 6b rtl RTL +.385b8c DISPLAY_NEXT_LINE_dep +.385b8c c2 20 rep #$20 REP #$20 ; set A long +.385b8e a5 1a lda $1a LDA CURSORX +.385b90 29 e0 ff and #$ffe0 AND #$FFE0 ; lines are $0, 80, 160, etc +.385b93 18 clc CLC +.385b94 69 6f 00 adc #$006f ADC #SCREEN_WIDTH + 31 ; move to the next line and offset to the file box +.385b97 85 1a sta $1a STA CURSORX +.385b99 e2 20 sep #$20 SEP #$20 ; set A short +.385b9b 6b rtl RTL +.385b9c DISPLAY_MSG +.385b9c 8b phb PHB +.385b9d 48 pha PHA ; begin setdbr macro +.385b9e 08 php PHP +.385b9f e2 20 sep #$20 SEP #$20 ; set A short +.385ba1 a9 00 lda #$00 LDA #`CS_COLOR_MEM_PTR ; store the initial colour buffer location +.385c1d 85 17 sta $17 STA CURSORPOS +.385c1f ad 1f 03 lda $031f LDA SDOS_LINE_SELECT +.385c22 8d 00 01 sta $0100 STA UNSIGNED_MULT_A +.385c25 a9 50 00 lda #$0050 LDA #SCREEN_WIDTH +.385c28 8d 02 01 sta $0102 STA UNSIGNED_MULT_B +.385c2b ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT +.385c2e 18 clc CLC +.385c2f 69 8f 03 adc #$038f ADC #SCREEN_WIDTH * 11 + 31 +.385c32 a8 tay TAY +.385c33 e2 20 sep #$20 SEP #$20 ; set A short +.385c35 a9 af lda #$af LDA #`CS_TEXT_MEM_PTR +.385c37 85 19 sta $19 STA CURSORPOS+2 +.385c39 a2 12 00 ldx #$0012 LDX #18 +.385c3c 68 pla PLA +.385c3d HS_LOOP +.385c3d 97 17 sta [$17],y STA [CURSORPOS],Y +.385c3f c8 iny INY +.385c40 ca dex DEX +.385c41 d0 fa bne $385c3d BNE HS_LOOP +.385c43 6b rtl RTL +.385c44 SELECT_NEXT_FILE +.385c44 18 clc CLC +.385c45 ad 1f 03 lda $031f LDA SDOS_LINE_SELECT +.385c48 1a inc a INC A +.385c49 c9 26 cmp #$26 CMP #38 +.385c4b b0 0f bcs $385c5c BCS DO_NOT_SELECT +.385c4d a9 50 lda #$50 LDA #$50 ; black background +.385c4f 22 17 5c 38 jsl $385c17 JSL TEXT_COLOUR_SELECTED +.385c53 ee 1f 03 inc $031f INC SDOS_LINE_SELECT +.385c56 a9 05 lda #$05 LDA #5 ; yellow background +.385c58 22 17 5c 38 jsl $385c17 JSL TEXT_COLOUR_SELECTED +.385c5c DO_NOT_SELECT +.385c5c 6b rtl RTL +.385c5d SELECT_PREVIOUS_FILE +.385c5d 18 clc CLC +.385c5e ad 1f 03 lda $031f LDA SDOS_LINE_SELECT +.385c61 3a dec a DEC A +.385c62 30 f8 bmi $385c5c BMI DO_NOT_SELECT +.385c64 a9 50 lda #$50 LDA #$50 ; black background +.385c66 22 17 5c 38 jsl $385c17 JSL TEXT_COLOUR_SELECTED +.385c6a ce 1f 03 dec $031f DEC SDOS_LINE_SELECT +.385c6d a9 05 lda #$05 LDA #5 ; yellow background +.385c6f 22 17 5c 38 jsl $385c17 JSL TEXT_COLOUR_SELECTED +.385c73 6b rtl RTL ;****** Return to file: tracker.asm @@ -5624,9 +5630,17 @@ =$afe880 GABE_MSTR_CTRL = $AFE880 =$01 GABE_CTRL_PWR_LED = $01 ; Controls the LED in the Front of the case (Next to the reset button) =$02 GABE_CTRL_SDC_LED = $02 ; Controls the LED in the Front of the Case (Next to SDCard) +=$04 GABE_CTRL_STS_LED0 = $04 ; Control Status LED0 (General Use) - C256 Foenix U Only +=$08 GABE_CTRL_STS_LED1 = $08 ; Control Status LED0 (General Use) - C256 Foenix U Only =$10 GABE_CTRL_BUZZER = $10 ; Controls the Buzzer =$80 GABE_CTRL_WRM_RST = $80 ; Warm Reset (needs to Setup other registers) -=$afe881 GABE_NOTUSED = $AFE881 ; Reserved for future use +=$afe881 GABE_LED_FLASH_CTRL = $AFE881 ; Flashing LED Control +=$01 GABE_LED0_FLASH_CTRL = $01 ; 0- Automatic Flash 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +=$02 GABE_LED1_FLASH_CTRL = $02 ; 0- Automatic Flash 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED1 to manually control) +=$10 GABE_LD0_FLASH_FRQ0 = $10 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +=$20 GABE_LD0_FLASH_FRQ1 = $20 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +=$40 GABE_LD1_FLASH_FRQ0 = $40 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) +=$80 GABE_LD1_FLASH_FRQ1 = $80 ; 1 - Bypass Flash Timer (Use GABE_CTRL_STS_LED0 to manually control) =$afe882 GABE_RST_AUTH0 = $AFE882 ; Must Contain the BYTE $AD for Reset to Activate =$afe883 GABE_RST_AUTH1 = $AFE883 ; Must Contain the BYTE $DE for Reset to Activate =$afe884 GABE_RNG_DAT_LO = $AFE884 ; Low Part of 16Bit RNG Generator @@ -5640,10 +5654,17 @@ =$02 GABE_RNG_CTRL_DV = $02 ; After Setting the Seed Value, Toggle that Bit for it be registered =$afe887 GABE_SYS_STAT = $AFE887 ; =$01 GABE_SYS_STAT_MID0 = $01 ; Machine ID -- LSB -=$02 GABE_SYS_STAT_MID1 = $02 ; Machine ID -- MSB -=$08 GABE_SYS_STAT_EXP = $08 ; if Zero, there is an Expansion Card Preset -=$40 GABE_SYS_STAT_CPUA = $40 ; Indicates the (8bit/16bit) Size of the Accumulator -=$80 GABE_SYS_STAT_CPUX = $80 ; Indicates the (8bit/16bit) Size of the Accumulator +=$02 GABE_SYS_STAT_MID1 = $02 ; Machine ID -- +=$04 GABE_SYS_STAT_MID2 = $04 ; Machine ID -- MSB +=$10 GABE_SYS_STAT_EXP = $10 ; if Zero, there is an Expansion Card Preset +=$40 GABE_SYS_STAT_CPUA = $40 ; Indicates the (8bit/16bit) Size of the Accumulator - Not Implemented +=$80 GABE_SYS_STAT_CPUX = $80 ; Indicates the (8bit/16bit) Size of the Accumulator - Not Implemented +=$afe88a GABE_SUBVERSION_LO = $AFE88A +=$afe88b GABE_SUBVERSION_HI = $AFE88B +=$afe88c GABE_VERSION_LO = $AFE88C +=$afe88d GABE_VERSION_HI = $AFE88D +=$afe88e GABE_MODEL_LO = $AFE88E +=$afe88f GABE_MODEL_HI = $AFE88F ;****** Return to file: SDOS.asm @@ -5704,26 +5725,26 @@ ;****** Return to file: SDOS.asm +=$0080 SD_DATA = $0080 ; 3 bytes - used indirect addressing +=$0083 SD_TMP_DATA = $0083 ; 3 bytes - used indirect addressing +=$0086 SD_DATA_FAT_PAGE = $0086 ; 2 bytes - last FAT page that was loaded +=$0088 SD_MULT_AREA = $0088 ; 4 bytes =$5f00 SD_FIRST_SECTOR = $5F00 ; 4 bytes =$5f04 SD_FAT_OFFSET = $5F04 ; 4 bytes =$5f08 SD_ROOT_OFFSET = $5F08 ; 4 bytes =$5f0c SD_DATA_OFFSET = $5F0C ; 4 bytes =$5f10 SD_RESERVED_SECTORS = $5F10 ; 2 bytes -=$5f12 SD_SECTORS_PER_FAT = $5F12 ; 2 bytes -=$5f14 SD_BYTES_PER_SECTOR = $5F14 ; 2 bytes -=$5f16 SD_FAT_COUNT = $5F16 ; 2 bytes -=$5f18 SD_SECTORS = $5F18 ; 4 bytes -=$5f1c SD_ROOT_ENTRIES = $5F1C ; 2 bytes +=$5f12 SD_SECTORS_PER_FAT = $5F12 ; 4 bytes - changed to 4 to allow FAT32 partitons +=$5f16 SD_BYTES_PER_SECTOR = $5F16 ; 2 bytes +=$5f18 SD_FAT_COUNT = $5F18 ; 2 bytes +=$5f1a SD_SECTORS = $5F1A ; 4 bytes +=$5f1e SD_ROOT_ENTRIES = $5F1E ; 2 bytes =$5f20 SD_DIR_OFFSET = $5F20 ; 2 bytes - use this to read the root directory -=$5f22 SD_NEXT_CLUSTER = $5F22 ; 2 bytes - use this to point to the next file cluster in the FAT +=$5f22 SD_NEXT_CLUSTER_NU = $5F22 ; 2 bytes - use this to point to the next file cluster in the FAT =$5f24 SD_SECTORS_PER_CLUSTER = $5F24 ; 2 byte -=$5f26 SD_FAT16 = $5F26 ; 1 byte - write 1 for FAT16, 0 for FAT12 +=$5f26 SD_FAT16_32 = $5F26 ; 1 byte - write 2 for FAT32, 1 for FAT16, 0 for FAT12 =$5f27 CLUSTER_PTR = $5F27 ; 2 bytes =$5f29 LOG_CLUSTER_PTR = $5F29 ; 4 bytes -=$0080 SD_DATA = $0080 ; 3 bytes - used indirect addressing -=$0083 SD_TMP_DATA = $0083 ; 3 bytes - used indirect addressing -=$0086 SD_DATA_FAT_PAGE = $0086 ; 2 bytes - last FAT page that was loaded -=$0088 SD_MULT_AREA = $0088 ; 4 bytes =$6000 SD_BLK_BEGIN = $6000 ; 512 bytes =$6200 SD_BTSCT_BEGIN = $6200 ; 512 bytes =$6400 SD_ROOT_BEGIN = $6400 ; 512 bytes @@ -5749,1480 +5770,1539 @@ >001a 00 00 cluster .word 0 >001c 00 00 size_l .word 0 >001e 00 00 size_h .word 0 -.385c82 ISDOS_INIT -.385c82 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL -.385c86 29 fd and #$fd AND #~GABE_CTRL_SDC_LED -.385c88 09 02 ora #$02 ORA #GABE_CTRL_SDC_LED -.385c8a 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL -.385c8e c2 20 rep #$20 REP #$20 ; set A long -.385c90 a9 00 00 lda #$0000 LDA #0 -.385c93 8d 08 5f sta $5f08 STA SD_ROOT_OFFSET -.385c96 8d 22 5f sta $5f22 STA SD_NEXT_CLUSTER -.385c99 e2 20 sep #$20 SEP #$20 ; set A short -.385c9b 85 3f sta $3f STA SDCARD_PRSNT_MNT -.385c9d a9 01 lda #$01 LDA #SDC_TRANS_INIT_SD -.385c9f 8f 02 ea af sta $afea02 STA SDC_TRANS_TYPE_REG -.385ca3 a9 01 lda #$01 LDA #SDC_TRANS_START -.385ca5 8f 03 ea af sta $afea03 STA SDC_TRANS_CONTROL_REG -.385ca9 af 04 ea af lda $afea04 SD_WAIT LDA SDC_TRANS_STATUS_REG -.385cad 29 01 and #$01 AND #SDC_TRANS_BUSY -.385caf c9 01 cmp #$01 CMP #SDC_TRANS_BUSY -.385cb1 f0 f6 beq $385ca9 BEQ SD_WAIT -.385cb3 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.385cb7 f0 08 beq $385cc1 BEQ SD_INIT_SUCCESS -.385cb9 a2 91 62 ldx #$6291 LDX #<>sd_no_card_msg -.385cbc 20 aa 5b jsr $385baa JSR DISPLAY_MSG -.385cbf 80 06 bra $385cc7 BRA SD_INIT_DONE -.385cc1 SD_INIT_SUCCESS -.385cc1 a9 01 lda #$01 LDA #1 -.385cc3 85 3f sta $3f STA SDCARD_PRSNT_MNT -.385cc5 80 00 bra $385cc7 BRA SD_INIT_DONE -.385cc7 SD_INIT_DONE -.385cc7 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL -.385ccb 29 fd and #$fd AND #~GABE_CTRL_SDC_LED -.385ccd 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL -.385cd1 6b rtl RTL -.385cd2 CALC_OFFSET_BYTES -.385cd2 a5 8a lda $8a LDA SD_MULT_AREA + 2 ; high 16-bits -.385cd4 0a asl a ASL A -.385cd5 85 8b sta $8b STA SD_MULT_AREA + 3 -.385cd7 18 clc CLC -.385cd8 a5 88 lda $88 LDA SD_MULT_AREA -.385cda 0a asl a ASL A -.385cdb 85 89 sta $89 STA SD_MULT_AREA + 1 -.385cdd 90 02 bcc $385ce1 BCC CALC_DONE -.385cdf e6 8b inc $8b INC SD_MULT_AREA + 3 -.385ce1 CALC_DONE -.385ce1 e2 20 sep #$20 SEP #$20 ; set A short -.385ce3 64 88 stz $88 stz SD_MULT_AREA -.385ce5 c2 20 rep #$20 REP #$20 ; set A long -.385ce7 60 rts RTS -.385ce8 ISDOS_READ_MBR_BOOT -.385ce8 a5 3f lda $3f LDA SDCARD_PRSNT_MNT ; this must be non-zero -.385cea d0 01 bne $385ced BNE RMBR_CARD_PRESENT -.385cec 6b rtl RTL -.385ced RMBR_CARD_PRESENT -.385ced c2 20 rep #$20 REP #$20 ; set A long -.385cef a9 00 60 lda #$6000 LDA #SD_BLK_BEGIN -.385cf2 85 80 sta $80 STA SD_DATA -.385cf4 a9 00 00 lda #$0000 LDA #0 -.385cf7 85 82 sta $82 STA SD_DATA + 2 -.385cf9 a9 00 00 lda #$0000 LDA #0 -.385cfc 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG -.385d00 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG -.385d04 e2 20 sep #$20 SEP #$20 ; set A short -.385d06 22 d2 5d 38 jsl $385dd2 JSL ISDOS_READ_BLOCK -.385d0a af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.385d0e f0 01 beq $385d11 BEQ SD_CONTINUE_1 -.385d10 6b rtl RTL -.385d11 SD_CONTINUE_1 -.385d11 c2 20 rep #$20 REP #$20 ; set A long -.385d13 ad fe 61 lda $61fe LDA SD_BLK_BEGIN + 510 -.385d16 c9 55 aa cmp #$aa55 CMP #$AA55 -.385d19 f0 01 beq $385d1c BEQ VALID_SIG -.385d1b 6b rtl RTL -.385d1c VALID_SIG -.385d1c c2 20 rep #$20 REP #$20 ; set A long -.385d1e a2 be 01 ldx #$01be LDX #446 ; offset to first partition -.385d21 bd 08 60 lda $6008,x LDA SD_BLK_BEGIN,X + 8 -.385d24 85 88 sta $88 STA SD_MULT_AREA -.385d26 bd 0a 60 lda $600a,x LDA SD_BLK_BEGIN,X + 10 -.385d29 85 8a sta $8a STA SD_MULT_AREA + 2 -.385d2b 20 d2 5c jsr $385cd2 JSR CALC_OFFSET_BYTES -.385d2e a5 88 lda $88 LDA SD_MULT_AREA -.385d30 8d 00 5f sta $5f00 STA SD_FIRST_SECTOR -.385d33 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG -.385d37 a5 8a lda $8a LDA SD_MULT_AREA + 2 -.385d39 8d 02 5f sta $5f02 STA SD_FIRST_SECTOR + 2 -.385d3c 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG -.385d40 a9 00 62 lda #$6200 LDA #SD_BTSCT_BEGIN -.385d43 85 80 sta $80 STA SD_DATA -.385d45 a9 00 00 lda #$0000 LDA #0 -.385d48 85 82 sta $82 STA SD_DATA + 2 -.385d4a e2 20 sep #$20 SEP #$20 ; set A short -.385d4c 22 d2 5d 38 jsl $385dd2 JSL ISDOS_READ_BLOCK -.385d50 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.385d54 f0 01 beq $385d57 BEQ SD_CONTINUE_2 -.385d56 6b rtl RTL -.385d57 SD_CONTINUE_2 -.385d57 c2 20 rep #$20 REP #$20 ; set A long -.385d59 a2 00 00 ldx #$0000 LDX #0 -.385d5c bd 0b 62 lda $620b,x LDA SD_BTSCT_BEGIN,X + $B -.385d5f 8d 14 5f sta $5f14 STA SD_BYTES_PER_SECTOR -.385d62 e2 20 sep #$20 SEP #$20 ; set A short -.385d64 bd 0d 62 lda $620d,x LDA SD_BTSCT_BEGIN,X + $D -.385d67 8d 24 5f sta $5f24 STA SD_SECTORS_PER_CLUSTER -.385d6a a9 00 lda #$00 LDA #0 -.385d6c 8d 25 5f sta $5f25 STA SD_SECTORS_PER_CLUSTER + 1 -.385d6f c2 20 rep #$20 REP #$20 ; set A long -.385d71 bd 10 62 lda $6210,x LDA SD_BTSCT_BEGIN,X + $10 -.385d74 29 ff 00 and #$00ff AND #$FF -.385d77 8d 16 5f sta $5f16 STA SD_FAT_COUNT -.385d7a bd 11 62 lda $6211,x LDA SD_BTSCT_BEGIN,X + $11 -.385d7d 8d 1c 5f sta $5f1c STA SD_ROOT_ENTRIES -.385d80 bd 13 62 lda $6213,x LDA SD_BTSCT_BEGIN,X + $13 -.385d83 f0 28 beq $385dad BEQ SD_LARGE_SECTORS -.385d85 8d 18 5f sta $5f18 STA SD_SECTORS -.385d88 a9 00 00 lda #$0000 LDA #0 -.385d8b 8d 1a 5f sta $5f1a STA SD_SECTORS + 2 -.385d8e ad 18 5f lda $5f18 LDA SD_SECTORS -.385d91 8d 12 01 sta $0112 STA D0_OPERAND_B -.385d94 ad 24 5f lda $5f24 LDA SD_SECTORS_PER_CLUSTER -.385d97 8d 10 01 sta $0110 STA D0_OPERAND_A -.385d9a ad 14 01 lda $0114 LDA D0_RESULT -.385d9d c9 f7 0f cmp #$0ff7 CMP #$FF7 -.385da0 b0 17 bcs $385db9 BCS SD_SMALL_SECTORS ; number of sectors is more than fat12 can handle -.385da2 e2 20 sep #$20 SEP #$20 ; set A short -.385da4 a9 00 lda #$00 LDA #0 -.385da6 8d 26 5f sta $5f26 STA SD_FAT16 -.385da9 c2 20 rep #$20 REP #$20 ; set A long -.385dab 80 15 bra $385dc2 BRA SD_FAT12 -.385dad SD_LARGE_SECTORS -.385dad bd 20 62 lda $6220,x LDA SD_BTSCT_BEGIN,X + $20 -.385db0 8d 18 5f sta $5f18 STA SD_SECTORS -.385db3 bd 22 62 lda $6222,x LDA SD_BTSCT_BEGIN,X + $22 -.385db6 8d 1a 5f sta $5f1a STA SD_SECTORS + 2 -.385db9 SD_SMALL_SECTORS -.385db9 e2 20 sep #$20 SEP #$20 ; set A short -.385dbb a9 01 lda #$01 LDA #1 -.385dbd 8d 26 5f sta $5f26 STA SD_FAT16 -.385dc0 c2 20 rep #$20 REP #$20 ; set A long -.385dc2 SD_FAT12 -.385dc2 bd 0e 62 lda $620e,x LDA SD_BTSCT_BEGIN,X + $E -.385dc5 8d 10 5f sta $5f10 STA SD_RESERVED_SECTORS -.385dc8 bd 16 62 lda $6216,x LDA SD_BTSCT_BEGIN,X + $16 -.385dcb 8d 12 5f sta $5f12 STA SD_SECTORS_PER_FAT -.385dce 20 c1 61 jsr $3861c1 JSR COMPUTE_FAT_ROOT_DATA_OFFSETS -.385dd1 RMBR_DONE -.385dd1 6b rtl RTL -.385dd2 ISDOS_READ_BLOCK -.385dd2 5a phy PHY -.385dd3 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL -.385dd7 29 fd and #$fd AND #~GABE_CTRL_SDC_LED -.385dd9 09 02 ora #$02 ORA #GABE_CTRL_SDC_LED -.385ddb 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL -.385ddf a5 3f lda $3f LDA SDCARD_PRSNT_MNT -.385de1 d0 02 bne $385de5 BNE SR_CARD_PRESENT -.385de3 80 2d bra $385e12 BRA SR_DONE -.385de5 SR_CARD_PRESENT -.385de5 a9 02 lda #$02 LDA #SDC_TRANS_READ_BLK -.385de7 8f 02 ea af sta $afea02 STA SDC_TRANS_TYPE_REG -.385deb a9 01 lda #$01 LDA #SDC_TRANS_START -.385ded 8f 03 ea af sta $afea03 STA SDC_TRANS_CONTROL_REG -.385df1 af 04 ea af lda $afea04 SR_WAIT LDA SDC_TRANS_STATUS_REG -.385df5 29 01 and #$01 AND #SDC_TRANS_BUSY -.385df7 c9 01 cmp #$01 CMP #SDC_TRANS_BUSY -.385df9 f0 f6 beq $385df1 BEQ SR_WAIT -.385dfb af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.385dff f0 02 beq $385e03 BEQ SD_READ_BLOCK_OK -.385e01 80 0f bra $385e12 BRA SR_DONE -.385e03 SD_READ_BLOCK_OK -.385e03 a0 00 00 ldy #$0000 LDY #0 -.385e06 SR_READ_LOOP -.385e06 af 10 ea af lda $afea10 LDA SDC_RX_FIFO_DATA_REG -.385e0a 97 80 sta [$80],y STA [SD_DATA],Y -.385e0c c8 iny INY -.385e0d c0 00 02 cpy #$0200 CPY #512 -.385e10 d0 f4 bne $385e06 BNE SR_READ_LOOP -.385e12 SR_DONE -.385e12 a9 01 lda #$01 LDA #1 -.385e14 8f 14 ea af sta $afea14 STA SDC_RX_FIFO_CTRL_REG -.385e18 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL -.385e1c 29 fd and #$fd AND #~GABE_CTRL_SDC_LED -.385e1e 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL -.385e22 7a ply PLY -.385e23 6b rtl RTL -.385e24 DISPLAY_FAT_NAME -.385e24 48 pha PHA ; - store the value of filetype -.385e25 a0 00 00 ldy #$0000 LDY #0 -.385e28 _RD_VOLNAME_LOOP -.385e28 b7 80 lda [$80],y LDA [SD_DATA],Y -.385e2a 22 18 10 00 jsl $001018 JSL PUTC -.385e2e c8 iny INY -.385e2f c0 08 00 cpy #$0008 CPY #8 -.385e32 f0 07 beq $385e3b BEQ _RD_DOT -.385e34 c0 0b 00 cpy #$000b CPY #11 -.385e37 d0 ef bne $385e28 BNE _RD_VOLNAME_LOOP -.385e39 80 0e bra $385e49 BRA _DFAT_NAME_DONE -.385e3b _RD_DOT -.385e3b 68 pla PLA ; - read the value of filetype -.385e3c 48 pha PHA ; - store the value of filetype -.385e3d 89 18 bit #$18 BIT #$18 -.385e3f d0 e7 bne $385e28 BNE _RD_VOLNAME_LOOP -.385e41 a9 2e lda #$2e LDA #"." -.385e43 22 18 10 00 jsl $001018 JSL PUTC -.385e47 80 df bra $385e28 BRA _RD_VOLNAME_LOOP -.385e49 _DFAT_NAME_DONE -.385e49 68 pla PLA ; - read the value of filetype -.385e4a 89 18 bit #$18 BIT #$18 -.385e4c d0 3b bne $385e89 BNE RD_DFAT_DONE -.385e4e a9 38 lda #$38 LDA #`sd_cluster_str -.385e50 8b phb PHB -.385e51 48 pha PHA -.385e52 ab plb PLB -.385e53 a2 c0 63 ldx #$63c0 LDX #<>sd_cluster_str -.385e56 22 1c 10 00 jsl $00101c JSL PUTS -.385e5a ab plb PLB -.385e5b a0 1b 00 ldy #$001b LDY #fatrec.cluster + 1 -.385e5e b7 80 lda [$80],y LDA [SD_DATA],Y -.385e60 22 80 10 00 jsl $001080 JSL PRINTAH -.385e64 a0 1a 00 ldy #$001a LDY #fatrec.cluster -.385e67 b7 80 lda [$80],y LDA [SD_DATA],Y -.385e69 22 80 10 00 jsl $001080 JSL PRINTAH -.385e6d a9 38 lda #$38 LDA #`sd_filesize_str -.385e6f 8b phb PHB -.385e70 48 pha PHA -.385e71 ab plb PLB -.385e72 a2 cb 63 ldx #$63cb LDX #<>sd_filesize_str -.385e75 22 1c 10 00 jsl $00101c JSL PUTS -.385e79 ab plb PLB -.385e7a a0 1f 00 ldy #$001f LDY #fatrec.size_h + 1 -.385e7d RD_SIZE_LOOP -.385e7d b7 80 lda [$80],y LDA [SD_DATA],Y -.385e7f 22 80 10 00 jsl $001080 JSL PRINTAH -.385e83 88 dey DEY -.385e84 c0 1b 00 cpy #$001b CPY #$1B -.385e87 d0 f4 bne $385e7d BNE RD_SIZE_LOOP -.385e89 RD_DFAT_DONE -.385e89 a9 0d lda #$0d LDA #$D -.385e8b 22 18 10 00 jsl $001018 JSL PUTC -.385e8f 60 rts RTS -.385e90 ISDOS_DISPLAY_ROOT_DIR -.385e90 a5 3f lda $3f LDA SDCARD_PRSNT_MNT ; this must be non-zero -.385e92 d0 01 bne $385e95 BNE RD_CARD_PRESENT -.385e94 6b rtl RTL -.385e95 RD_CARD_PRESENT -.385e95 c2 20 rep #$20 REP #$20 ; set A long -.385e97 a9 00 00 lda #$0000 LDA #0 ; reset the root entries offset -.385e9a 8d 20 5f sta $5f20 STA SD_DIR_OFFSET -.385e9d RD_NEXT_SECTOR -.385e9d a9 00 64 lda #$6400 LDA #SD_ROOT_BEGIN -.385ea0 85 80 sta $80 STA SD_DATA -.385ea2 a9 00 00 lda #$0000 LDA #0 -.385ea5 85 82 sta $82 STA SD_DATA + 2 -.385ea7 ad 20 5f lda $5f20 LDA SD_DIR_OFFSET ; multiply by 512 -.385eaa 0a asl a ASL A -.385eab eb xba XBA -.385eac 8d 20 01 sta $0120 STA ADDER_A -.385eaf a9 00 00 lda #$0000 LDA #0 -.385eb2 8d 22 01 sta $0122 STA ADDER_A + 2 -.385eb5 ad 08 5f lda $5f08 LDA SD_ROOT_OFFSET -.385eb8 8d 24 01 sta $0124 STA ADDER_B -.385ebb ad 0a 5f lda $5f0a LDA SD_ROOT_OFFSET+2 -.385ebe 8d 26 01 sta $0126 STA ADDER_B + 2 -.385ec1 ad 28 01 lda $0128 LDA ADDER_R -.385ec4 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG -.385ec8 ad 2a 01 lda $012a LDA ADDER_R + 2 -.385ecb 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG -.385ecf e2 20 sep #$20 SEP #$20 ; set A short -.385ed1 22 d2 5d 38 jsl $385dd2 JSL ISDOS_READ_BLOCK -.385ed5 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.385ed9 f0 08 beq $385ee3 BEQ RD_DIR_ENTRY -.385edb a2 31 63 ldx #$6331 LDX #<>SD_ROOT_ERROR_MSG -.385ede 20 aa 5b jsr $385baa JSR DISPLAY_MSG -.385ee1 80 6a bra $385f4d BRA RD_DONE -.385ee3 RD_DIR_ENTRY -.385ee3 a7 80 lda [$80] LDA [SD_DATA] -.385ee5 d0 04 bne $385eeb BNE RD_CONTINUE ; if first byte is 0, entry is available and there are no following entries -.385ee7 5c 4d 5f 38 jmp $385f4d JML RD_DONE -.385eeb RD_CONTINUE -.385eeb c9 e5 cmp #$e5 CMP #$E5 -.385eed f0 35 beq $385f24 BEQ RD_SKIP -.385eef RD_LOOP -.385eef a0 0b 00 ldy #$000b LDY #fatrec.type -.385ef2 b7 80 lda [$80],y LDA [SD_DATA],Y -.385ef4 c9 0f cmp #$0f CMP #$F ; long file name -.385ef6 d0 04 bne $385efc BNE RD_NOT_VFAT -.385ef8 5c 78 5f 38 jmp $385f78 JML RD_READ_LONG_FILENAME -.385efc RD_NOT_VFAT -.385efc 89 02 bit #$02 BIT #2 ; hidden -.385efe f0 02 beq $385f02 BEQ RD_NOT_HIDDEN -.385f00 80 22 bra $385f24 BRA RD_SKIP -.385f02 RD_NOT_HIDDEN -.385f02 89 08 bit #$08 BIT #8 ; volume name -.385f04 f0 04 beq $385f0a BEQ RD_NOT_VOLUME -.385f06 5c 63 5f 38 jmp $385f63 JML RD_READ_VOLNAME -.385f0a RD_NOT_VOLUME -.385f0a 89 10 bit #$10 BIT #$10 ; directory -.385f0c f0 04 beq $385f12 BEQ RD_NOT_DIRECTORY -.385f0e 5c 4e 5f 38 jmp $385f4e JML RD_DIRNAME -.385f12 RD_NOT_DIRECTORY -.385f12 48 pha PHA ; - store the value of filetype -.385f13 a9 38 lda #$38 LDA #`sd_filename -.385f15 8b phb PHB -.385f16 48 pha PHA -.385f17 ab plb PLB -.385f18 a2 b2 63 ldx #$63b2 LDX #<>sd_filename -.385f1b 22 1c 10 00 jsl $00101c JSL PUTS -.385f1f ab plb PLB -.385f20 68 pla PLA -.385f21 20 24 5e jsr $385e24 JSR DISPLAY_FAT_NAME -.385f24 RD_SKIP -.385f24 c2 20 rep #$20 REP #$20 ; set A long -.385f26 a5 80 lda $80 LDA SD_DATA -.385f28 29 e0 01 and #$01e0 AND #$1E0 -.385f2b c9 e0 01 cmp #$01e0 CMP #$1E0 -.385f2e d0 0f bne $385f3f BNE RD_SKIP_NEXT -.385f30 ad 20 5f lda $5f20 LDA SD_DIR_OFFSET -.385f33 1a inc a INC A -.385f34 cd 1c 5f cmp $5f1c CMP SD_ROOT_ENTRIES -.385f37 b0 14 bcs $385f4d BCS RD_DONE -.385f39 8d 20 5f sta $5f20 STA SD_DIR_OFFSET ; next sector -.385f3c 4c 9d 5e jmp $385e9d JMP RD_NEXT_SECTOR -.385f3f RD_SKIP_NEXT -.385f3f a5 80 lda $80 LDA SD_DATA -.385f41 18 clc CLC -.385f42 69 20 00 adc #$0020 ADC #$20 -.385f45 85 80 sta $80 STA SD_DATA -.385f47 e2 20 sep #$20 SEP #$20 ; set A short -.385f49 5c e3 5e 38 jmp $385ee3 JML RD_DIR_ENTRY -.385f4d RD_DONE -.385f4d 6b rtl RTL -.385f4e RD_DIRNAME -.385f4e 48 pha PHA ; - store the value of filetype -.385f4f a9 38 lda #$38 LDA #`sd_dir_name -.385f51 8b phb PHB -.385f52 48 pha PHA -.385f53 ab plb PLB -.385f54 a2 a4 63 ldx #$63a4 LDX #<>sd_dir_name -.385f57 22 1c 10 00 jsl $00101c JSL PUTS -.385f5b ab plb PLB -.385f5c 68 pla PLA -.385f5d 20 24 5e jsr $385e24 JSR DISPLAY_FAT_NAME -.385f60 4c 24 5f jmp $385f24 JMP RD_SKIP -.385f63 RD_READ_VOLNAME -.385f63 48 pha PHA ; - store the value of filetype -.385f64 a9 38 lda #$38 LDA #`sd_volume_name -.385f66 8b phb PHB -.385f67 48 pha PHA -.385f68 ab plb PLB -.385f69 a2 88 63 ldx #$6388 LDX #<>sd_volume_name -.385f6c 22 1c 10 00 jsl $00101c JSL PUTS -.385f70 ab plb PLB -.385f71 68 pla PLA -.385f72 20 24 5e jsr $385e24 JSR DISPLAY_FAT_NAME -.385f75 4c 24 5f jmp $385f24 JMP RD_SKIP -.385f78 RD_READ_LONG_FILENAME -.385f78 4c 24 5f jmp $385f24 JMP RD_SKIP -.385f7b STORE_FILE_LIST -.385f7b a0 0b 00 ldy #$000b LDY #11 -.385f7e c9 10 cmp #$10 CMP #$10 -.385f80 f0 02 beq $385f84 BEQ SF_DIR -.385f82 a9 01 lda #$01 LDA #1 -.385f84 SF_DIR -.385f84 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y -.385f86 a0 00 00 ldy #$0000 LDY #0 -.385f89 a2 0b 00 ldx #$000b LDX #11 -.385f8c SF_LOOP_NAME -.385f8c b7 80 lda [$80],y LDA [SD_DATA],Y -.385f8e 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y -.385f90 c8 iny INY -.385f91 ca dex DEX -.385f92 d0 f8 bne $385f8c BNE SF_LOOP_NAME -.385f94 c2 20 rep #$20 REP #$20 ; set A long -.385f96 a0 1a 00 ldy #$001a LDY #fatrec.cluster -.385f99 b7 80 lda [$80],y LDA [SD_DATA],Y -.385f9b a0 10 00 ldy #$0010 LDY #16 -.385f9e 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y -.385fa0 a0 1c 00 ldy #$001c LDY #fatrec.size_l -.385fa3 b7 80 lda [$80],y LDA [SD_DATA],Y -.385fa5 a0 0c 00 ldy #$000c LDY #12 -.385fa8 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y -.385faa a0 1e 00 ldy #$001e LDY #fatrec.size_h +.385c74 ISDOS_INIT +.385c74 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL +.385c78 29 fd and #$fd AND #~GABE_CTRL_SDC_LED +.385c7a 09 02 ora #$02 ORA #GABE_CTRL_SDC_LED +.385c7c 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL +.385c80 c2 20 rep #$20 REP #$20 ; set A long +.385c82 a9 00 00 lda #$0000 LDA #0 +.385c85 8d 08 5f sta $5f08 STA SD_ROOT_OFFSET +.385c88 e2 20 sep #$20 SEP #$20 ; set A short +.385c8a 85 3f sta $3f STA SDCARD_PRSNT_MNT +.385c8c a9 01 lda #$01 LDA #SDC_TRANS_INIT_SD +.385c8e 8f 02 ea af sta $afea02 STA SDC_TRANS_TYPE_REG +.385c92 a9 01 lda #$01 LDA #SDC_TRANS_START +.385c94 8f 03 ea af sta $afea03 STA SDC_TRANS_CONTROL_REG +.385c98 af 04 ea af lda $afea04 SD_WAIT LDA SDC_TRANS_STATUS_REG +.385c9c 29 01 and #$01 AND #SDC_TRANS_BUSY +.385c9e c9 01 cmp #$01 CMP #SDC_TRANS_BUSY +.385ca0 f0 f6 beq $385c98 BEQ SD_WAIT +.385ca2 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.385ca6 f0 08 beq $385cb0 BEQ SD_INIT_SUCCESS +.385ca8 a2 f9 62 ldx #$62f9 LDX #<>sd_no_card_msg +.385cab 20 9c 5b jsr $385b9c JSR DISPLAY_MSG +.385cae 80 06 bra $385cb6 BRA SD_INIT_DONE +.385cb0 SD_INIT_SUCCESS +.385cb0 a9 01 lda #$01 LDA #1 +.385cb2 85 3f sta $3f STA SDCARD_PRSNT_MNT +.385cb4 80 00 bra $385cb6 BRA SD_INIT_DONE +.385cb6 SD_INIT_DONE +.385cb6 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL +.385cba 29 fd and #$fd AND #~GABE_CTRL_SDC_LED +.385cbc 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL +.385cc0 6b rtl RTL +.385cc1 CALC_OFFSET_BYTES +.385cc1 a5 8a lda $8a LDA SD_MULT_AREA + 2 ; high 16-bits +.385cc3 0a asl a ASL A +.385cc4 85 8b sta $8b STA SD_MULT_AREA + 3 +.385cc6 18 clc CLC +.385cc7 a5 88 lda $88 LDA SD_MULT_AREA +.385cc9 0a asl a ASL A +.385cca 85 89 sta $89 STA SD_MULT_AREA + 1 +.385ccc 90 02 bcc $385cd0 BCC CALC_DONE +.385cce e6 8b inc $8b INC SD_MULT_AREA + 3 +.385cd0 CALC_DONE +.385cd0 e2 20 sep #$20 SEP #$20 ; set A short +.385cd2 64 88 stz $88 stz SD_MULT_AREA +.385cd4 c2 20 rep #$20 REP #$20 ; set A long +.385cd6 60 rts RTS +.385cd7 ISDOS_READ_MBR_AND_BOOT_SECTOR +.385cd7 a5 3f lda $3f LDA SDCARD_PRSNT_MNT ; this must be non-zero +.385cd9 d0 01 bne $385cdc BNE RMBR_CARD_PRESENT +.385cdb 6b rtl RTL +.385cdc RMBR_CARD_PRESENT +.385cdc c2 20 rep #$20 REP #$20 ; set A long +.385cde a9 00 60 lda #$6000 LDA #SD_BLK_BEGIN +.385ce1 85 80 sta $80 STA SD_DATA +.385ce3 a9 00 00 lda #$0000 LDA #0 +.385ce6 85 82 sta $82 STA SD_DATA + 2 +.385ce8 a9 00 00 lda #$0000 LDA #0 +.385ceb 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG +.385cef 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG +.385cf3 e2 20 sep #$20 SEP #$20 ; set A short +.385cf5 22 e6 5d 38 jsl $385de6 JSL ISDOS_READ_BLOCK +.385cf9 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.385cfd f0 01 beq $385d00 BEQ SD_CONTINUE_1 +.385cff 6b rtl RTL +.385d00 SD_CONTINUE_1 +.385d00 c2 20 rep #$20 REP #$20 ; set A long +.385d02 ad fe 61 lda $61fe LDA SD_BLK_BEGIN + 510 +.385d05 c9 55 aa cmp #$aa55 CMP #$AA55 +.385d08 f0 01 beq $385d0b BEQ VALID_SIG +.385d0a 6b rtl RTL +.385d0b VALID_SIG +.385d0b c2 20 rep #$20 REP #$20 ; set A long +.385d0d a2 be 01 ldx #$01be LDX #446 ; offset to first partition +.385d10 bd 08 60 lda $6008,x LDA SD_BLK_BEGIN,X + 8 +.385d13 85 88 sta $88 STA SD_MULT_AREA +.385d15 bd 0a 60 lda $600a,x LDA SD_BLK_BEGIN,X + 10 +.385d18 85 8a sta $8a STA SD_MULT_AREA + 2 +.385d1a 20 c1 5c jsr $385cc1 JSR CALC_OFFSET_BYTES +.385d1d a5 88 lda $88 LDA SD_MULT_AREA +.385d1f 8d 00 5f sta $5f00 STA SD_FIRST_SECTOR +.385d22 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG +.385d26 a5 8a lda $8a LDA SD_MULT_AREA + 2 +.385d28 8d 02 5f sta $5f02 STA SD_FIRST_SECTOR + 2 +.385d2b 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG +.385d2f a9 00 62 lda #$6200 LDA #SD_BTSCT_BEGIN +.385d32 85 80 sta $80 STA SD_DATA +.385d34 a9 00 00 lda #$0000 LDA #0 +.385d37 85 82 sta $82 STA SD_DATA + 2 +.385d39 e2 20 sep #$20 SEP #$20 ; set A short +.385d3b 22 e6 5d 38 jsl $385de6 JSL ISDOS_READ_BLOCK +.385d3f af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.385d43 f0 01 beq $385d46 BEQ SD_CONTINUE_2 +.385d45 6b rtl RTL +.385d46 SD_CONTINUE_2 +.385d46 c2 20 rep #$20 REP #$20 ; set A long +.385d48 a2 00 00 ldx #$0000 LDX #0 +.385d4b bd 0b 62 lda $620b,x LDA SD_BTSCT_BEGIN,X + $B +.385d4e 8d 16 5f sta $5f16 STA SD_BYTES_PER_SECTOR +.385d51 e2 20 sep #$20 SEP #$20 ; set A short +.385d53 bd 0d 62 lda $620d,x LDA SD_BTSCT_BEGIN,X + $D +.385d56 8d 24 5f sta $5f24 STA SD_SECTORS_PER_CLUSTER +.385d59 a9 00 lda #$00 LDA #0 +.385d5b 8d 25 5f sta $5f25 STA SD_SECTORS_PER_CLUSTER + 1 +.385d5e c2 20 rep #$20 REP #$20 ; set A long +.385d60 bd 10 62 lda $6210,x LDA SD_BTSCT_BEGIN,X + $10 +.385d63 29 ff 00 and #$00ff AND #$FF +.385d66 8d 18 5f sta $5f18 STA SD_FAT_COUNT +.385d69 bd 11 62 lda $6211,x LDA SD_BTSCT_BEGIN,X + $11 +.385d6c 8d 1e 5f sta $5f1e STA SD_ROOT_ENTRIES +.385d6f bd 13 62 lda $6213,x LDA SD_BTSCT_BEGIN,X + $13 +.385d72 f0 28 beq $385d9c BEQ SD_LARGE_SECTORS +.385d74 8d 1a 5f sta $5f1a STA SD_SECTORS +.385d77 a9 00 00 lda #$0000 LDA #0 +.385d7a 8d 1c 5f sta $5f1c STA SD_SECTORS + 2 +.385d7d ad 1a 5f lda $5f1a LDA SD_SECTORS +.385d80 8d 12 01 sta $0112 STA D0_OPERAND_B +.385d83 ad 24 5f lda $5f24 LDA SD_SECTORS_PER_CLUSTER +.385d86 8d 10 01 sta $0110 STA D0_OPERAND_A +.385d89 ad 14 01 lda $0114 LDA D0_RESULT +.385d8c c9 f7 0f cmp #$0ff7 CMP #$FF7 +.385d8f b0 1d bcs $385dae BCS SD_SMALL_SECTORS ; number of sectors is more than fat12 can handle +.385d91 e2 20 sep #$20 SEP #$20 ; set A short +.385d93 a9 00 lda #$00 LDA #0 +.385d95 8d 26 5f sta $5f26 STA SD_FAT16_32 +.385d98 c2 20 rep #$20 REP #$20 ; set A long +.385d9a 80 1b bra $385db7 BRA SD_FAT12 +.385d9c SD_LARGE_SECTORS +.385d9c bd 20 62 lda $6220,x LDA SD_BTSCT_BEGIN,X + $20 +.385d9f 8d 1a 5f sta $5f1a STA SD_SECTORS +.385da2 bd 22 62 lda $6222,x LDA SD_BTSCT_BEGIN,X + $22 +.385da5 8d 1c 5f sta $5f1c STA SD_SECTORS + 2 +.385da8 a9 ff ff lda #$ffff LDA #$FFFF +.385dab 8d 1e 5f sta $5f1e STA SD_ROOT_ENTRIES +.385dae SD_SMALL_SECTORS +.385dae e2 20 sep #$20 SEP #$20 ; set A short +.385db0 a9 01 lda #$01 LDA #1 +.385db2 8d 26 5f sta $5f26 STA SD_FAT16_32 +.385db5 c2 20 rep #$20 REP #$20 ; set A long +.385db7 SD_FAT12 +.385db7 bd 0e 62 lda $620e,x LDA SD_BTSCT_BEGIN,X + $E +.385dba 8d 10 5f sta $5f10 STA SD_RESERVED_SECTORS +.385dbd bd 16 62 lda $6216,x LDA SD_BTSCT_BEGIN,X + $16 +.385dc0 f0 0b beq $385dcd BEQ SD_FAT32_SECTORS ; if sectors per FAT is 0, then this is a FAT32 partition +.385dc2 8d 12 5f sta $5f12 STA SD_SECTORS_PER_FAT +.385dc5 a9 00 00 lda #$0000 LDA #0 +.385dc8 8d 14 5f sta $5f14 STA SD_SECTORS_PER_FAT + 2 +.385dcb 80 15 bra $385de2 BRA SD_COMPUTE_OFFSETS +.385dcd SD_FAT32_SECTORS +.385dcd e2 20 sep #$20 SEP #$20 ; set A short +.385dcf a9 02 lda #$02 LDA #2 ; identify the FAT32 partition +.385dd1 8d 26 5f sta $5f26 STA SD_FAT16_32 +.385dd4 c2 20 rep #$20 REP #$20 ; set A long +.385dd6 bd 24 62 lda $6224,x LDA SD_BTSCT_BEGIN,X + $24 +.385dd9 8d 12 5f sta $5f12 STA SD_SECTORS_PER_FAT +.385ddc bd 26 62 lda $6226,x LDA SD_BTSCT_BEGIN,X + $26 +.385ddf 8d 14 5f sta $5f14 STA SD_SECTORS_PER_FAT+2 +.385de2 SD_COMPUTE_OFFSETS +.385de2 20 29 62 jsr $386229 JSR COMPUTE_FAT_ROOT_DATA_OFFSETS +.385de5 RMBR_DONE +.385de5 6b rtl RTL +.385de6 ISDOS_READ_BLOCK +.385de6 5a phy PHY +.385de7 af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL +.385deb 29 fd and #$fd AND #~GABE_CTRL_SDC_LED +.385ded 09 02 ora #$02 ORA #GABE_CTRL_SDC_LED +.385def 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL +.385df3 a5 3f lda $3f LDA SDCARD_PRSNT_MNT +.385df5 d0 02 bne $385df9 BNE SR_CARD_PRESENT +.385df7 80 2d bra $385e26 BRA SR_DONE +.385df9 SR_CARD_PRESENT +.385df9 a9 02 lda #$02 LDA #SDC_TRANS_READ_BLK +.385dfb 8f 02 ea af sta $afea02 STA SDC_TRANS_TYPE_REG +.385dff a9 01 lda #$01 LDA #SDC_TRANS_START +.385e01 8f 03 ea af sta $afea03 STA SDC_TRANS_CONTROL_REG +.385e05 af 04 ea af lda $afea04 SR_WAIT LDA SDC_TRANS_STATUS_REG +.385e09 29 01 and #$01 AND #SDC_TRANS_BUSY +.385e0b c9 01 cmp #$01 CMP #SDC_TRANS_BUSY +.385e0d f0 f6 beq $385e05 BEQ SR_WAIT +.385e0f af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.385e13 f0 02 beq $385e17 BEQ SD_READ_BLOCK_OK +.385e15 80 0f bra $385e26 BRA SR_DONE +.385e17 SD_READ_BLOCK_OK +.385e17 a0 00 00 ldy #$0000 LDY #0 +.385e1a SR_READ_LOOP +.385e1a af 10 ea af lda $afea10 LDA SDC_RX_FIFO_DATA_REG +.385e1e 97 80 sta [$80],y STA [SD_DATA],Y +.385e20 c8 iny INY +.385e21 c0 00 02 cpy #$0200 CPY #512 +.385e24 d0 f4 bne $385e1a BNE SR_READ_LOOP +.385e26 SR_DONE +.385e26 a9 01 lda #$01 LDA #1 +.385e28 8f 14 ea af sta $afea14 STA SDC_RX_FIFO_CTRL_REG +.385e2c af 80 e8 af lda $afe880 LDA GABE_MSTR_CTRL +.385e30 29 fd and #$fd AND #~GABE_CTRL_SDC_LED +.385e32 8f 80 e8 af sta $afe880 STA GABE_MSTR_CTRL +.385e36 7a ply PLY +.385e37 6b rtl RTL +.385e38 DISPLAY_FAT_NAME +.385e38 48 pha PHA ; - store the value of filetype +.385e39 a0 00 00 ldy #$0000 LDY #0 +.385e3c _RD_VOLNAME_LOOP +.385e3c b7 80 lda [$80],y LDA [SD_DATA],Y +.385e3e 22 18 10 00 jsl $001018 JSL PUTC +.385e42 c8 iny INY +.385e43 c0 08 00 cpy #$0008 CPY #8 +.385e46 f0 07 beq $385e4f BEQ _RD_DOT +.385e48 c0 0b 00 cpy #$000b CPY #11 +.385e4b d0 ef bne $385e3c BNE _RD_VOLNAME_LOOP +.385e4d 80 0e bra $385e5d BRA _DFAT_NAME_DONE +.385e4f _RD_DOT +.385e4f 68 pla PLA ; - read the value of filetype +.385e50 48 pha PHA ; - store the value of filetype +.385e51 89 18 bit #$18 BIT #$18 +.385e53 d0 e7 bne $385e3c BNE _RD_VOLNAME_LOOP +.385e55 a9 2e lda #$2e LDA #"." +.385e57 22 18 10 00 jsl $001018 JSL PUTC +.385e5b 80 df bra $385e3c BRA _RD_VOLNAME_LOOP +.385e5d _DFAT_NAME_DONE +.385e5d 68 pla PLA ; - read the value of filetype +.385e5e 89 18 bit #$18 BIT #$18 +.385e60 d0 3b bne $385e9d BNE RD_DFAT_DONE +.385e62 a9 38 lda #$38 LDA #`sd_cluster_str +.385e64 8b phb PHB +.385e65 48 pha PHA +.385e66 ab plb PLB +.385e67 a2 28 64 ldx #$6428 LDX #<>sd_cluster_str +.385e6a 22 1c 10 00 jsl $00101c JSL PUTS +.385e6e ab plb PLB +.385e6f a0 1b 00 ldy #$001b LDY #fatrec.cluster + 1 +.385e72 b7 80 lda [$80],y LDA [SD_DATA],Y +.385e74 22 80 10 00 jsl $001080 JSL PRINTAH +.385e78 a0 1a 00 ldy #$001a LDY #fatrec.cluster +.385e7b b7 80 lda [$80],y LDA [SD_DATA],Y +.385e7d 22 80 10 00 jsl $001080 JSL PRINTAH +.385e81 a9 38 lda #$38 LDA #`sd_filesize_str +.385e83 8b phb PHB +.385e84 48 pha PHA +.385e85 ab plb PLB +.385e86 a2 33 64 ldx #$6433 LDX #<>sd_filesize_str +.385e89 22 1c 10 00 jsl $00101c JSL PUTS +.385e8d ab plb PLB +.385e8e a0 1f 00 ldy #$001f LDY #fatrec.size_h + 1 +.385e91 RD_SIZE_LOOP +.385e91 b7 80 lda [$80],y LDA [SD_DATA],Y +.385e93 22 80 10 00 jsl $001080 JSL PRINTAH +.385e97 88 dey DEY +.385e98 c0 1b 00 cpy #$001b CPY #$1B +.385e9b d0 f4 bne $385e91 BNE RD_SIZE_LOOP +.385e9d RD_DFAT_DONE +.385e9d a9 0d lda #$0d LDA #$D +.385e9f 22 18 10 00 jsl $001018 JSL PUTC +.385ea3 60 rts RTS +.385ea4 ISDOS_DISPLAY_ROOT_DIR +.385ea4 a5 3f lda $3f LDA SDCARD_PRSNT_MNT ; this must be non-zero +.385ea6 d0 01 bne $385ea9 BNE RD_CARD_PRESENT +.385ea8 6b rtl RTL +.385ea9 RD_CARD_PRESENT +.385ea9 c2 20 rep #$20 REP #$20 ; set A long +.385eab a9 00 00 lda #$0000 LDA #0 ; reset the root entries offset +.385eae 8d 20 5f sta $5f20 STA SD_DIR_OFFSET +.385eb1 RD_NEXT_SECTOR +.385eb1 a9 00 64 lda #$6400 LDA #SD_ROOT_BEGIN +.385eb4 85 80 sta $80 STA SD_DATA +.385eb6 a9 00 00 lda #$0000 LDA #0 +.385eb9 85 82 sta $82 STA SD_DATA + 2 +.385ebb ad 20 5f lda $5f20 LDA SD_DIR_OFFSET ; multiply by 512 +.385ebe 0a asl a ASL A +.385ebf eb xba XBA +.385ec0 8d 20 01 sta $0120 STA ADDER_A +.385ec3 a9 00 00 lda #$0000 LDA #0 +.385ec6 8d 22 01 sta $0122 STA ADDER_A + 2 +.385ec9 ad 08 5f lda $5f08 LDA SD_ROOT_OFFSET +.385ecc 8d 24 01 sta $0124 STA ADDER_B +.385ecf ad 0a 5f lda $5f0a LDA SD_ROOT_OFFSET+2 +.385ed2 8d 26 01 sta $0126 STA ADDER_B + 2 +.385ed5 ad 28 01 lda $0128 LDA ADDER_R +.385ed8 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG +.385edc ad 2a 01 lda $012a LDA ADDER_R + 2 +.385edf 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG +.385ee3 e2 20 sep #$20 SEP #$20 ; set A short +.385ee5 22 e6 5d 38 jsl $385de6 JSL ISDOS_READ_BLOCK +.385ee9 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.385eed f0 08 beq $385ef7 BEQ RD_DIR_ENTRY +.385eef a2 99 63 ldx #$6399 LDX #<>SD_ROOT_ERROR_MSG +.385ef2 20 9c 5b jsr $385b9c JSR DISPLAY_MSG +.385ef5 80 6a bra $385f61 BRA RD_DONE +.385ef7 RD_DIR_ENTRY +.385ef7 a7 80 lda [$80] LDA [SD_DATA] +.385ef9 d0 04 bne $385eff BNE RD_CONTINUE ; if first byte is 0, entry is available and there are no following entries +.385efb 5c 61 5f 38 jmp $385f61 JML RD_DONE +.385eff RD_CONTINUE +.385eff c9 e5 cmp #$e5 CMP #$E5 +.385f01 f0 35 beq $385f38 BEQ RD_SKIP +.385f03 RD_LOOP +.385f03 a0 0b 00 ldy #$000b LDY #fatrec.type +.385f06 b7 80 lda [$80],y LDA [SD_DATA],Y +.385f08 c9 0f cmp #$0f CMP #$F ; long file name +.385f0a d0 04 bne $385f10 BNE RD_NOT_VFAT +.385f0c 5c 8c 5f 38 jmp $385f8c JML RD_READ_LONG_FILENAME +.385f10 RD_NOT_VFAT +.385f10 89 02 bit #$02 BIT #2 ; hidden +.385f12 f0 02 beq $385f16 BEQ RD_NOT_HIDDEN +.385f14 80 22 bra $385f38 BRA RD_SKIP +.385f16 RD_NOT_HIDDEN +.385f16 89 08 bit #$08 BIT #8 ; volume name +.385f18 f0 04 beq $385f1e BEQ RD_NOT_VOLUME +.385f1a 5c 77 5f 38 jmp $385f77 JML RD_READ_VOLNAME +.385f1e RD_NOT_VOLUME +.385f1e 89 10 bit #$10 BIT #$10 ; directory +.385f20 f0 04 beq $385f26 BEQ RD_NOT_DIRECTORY +.385f22 5c 62 5f 38 jmp $385f62 JML RD_DIRNAME +.385f26 RD_NOT_DIRECTORY +.385f26 48 pha PHA ; - store the value of filetype +.385f27 a9 38 lda #$38 LDA #`sd_filename +.385f29 8b phb PHB +.385f2a 48 pha PHA +.385f2b ab plb PLB +.385f2c a2 1a 64 ldx #$641a LDX #<>sd_filename +.385f2f 22 1c 10 00 jsl $00101c JSL PUTS +.385f33 ab plb PLB +.385f34 68 pla PLA +.385f35 20 38 5e jsr $385e38 JSR DISPLAY_FAT_NAME +.385f38 RD_SKIP +.385f38 c2 20 rep #$20 REP #$20 ; set A long +.385f3a a5 80 lda $80 LDA SD_DATA +.385f3c 29 e0 01 and #$01e0 AND #$1E0 +.385f3f c9 e0 01 cmp #$01e0 CMP #$1E0 +.385f42 d0 0f bne $385f53 BNE RD_SKIP_NEXT +.385f44 ad 20 5f lda $5f20 LDA SD_DIR_OFFSET +.385f47 1a inc a INC A +.385f48 cd 1e 5f cmp $5f1e CMP SD_ROOT_ENTRIES +.385f4b b0 14 bcs $385f61 BCS RD_DONE +.385f4d 8d 20 5f sta $5f20 STA SD_DIR_OFFSET ; next sector +.385f50 4c b1 5e jmp $385eb1 JMP RD_NEXT_SECTOR +.385f53 RD_SKIP_NEXT +.385f53 a5 80 lda $80 LDA SD_DATA +.385f55 18 clc CLC +.385f56 69 20 00 adc #$0020 ADC #$20 +.385f59 85 80 sta $80 STA SD_DATA +.385f5b e2 20 sep #$20 SEP #$20 ; set A short +.385f5d 5c f7 5e 38 jmp $385ef7 JML RD_DIR_ENTRY +.385f61 RD_DONE +.385f61 6b rtl RTL +.385f62 RD_DIRNAME +.385f62 48 pha PHA ; - store the value of filetype +.385f63 a9 38 lda #$38 LDA #`sd_dir_name +.385f65 8b phb PHB +.385f66 48 pha PHA +.385f67 ab plb PLB +.385f68 a2 0c 64 ldx #$640c LDX #<>sd_dir_name +.385f6b 22 1c 10 00 jsl $00101c JSL PUTS +.385f6f ab plb PLB +.385f70 68 pla PLA +.385f71 20 38 5e jsr $385e38 JSR DISPLAY_FAT_NAME +.385f74 4c 38 5f jmp $385f38 JMP RD_SKIP +.385f77 RD_READ_VOLNAME +.385f77 48 pha PHA ; - store the value of filetype +.385f78 a9 38 lda #$38 LDA #`sd_volume_name +.385f7a 8b phb PHB +.385f7b 48 pha PHA +.385f7c ab plb PLB +.385f7d a2 f0 63 ldx #$63f0 LDX #<>sd_volume_name +.385f80 22 1c 10 00 jsl $00101c JSL PUTS +.385f84 ab plb PLB +.385f85 68 pla PLA +.385f86 20 38 5e jsr $385e38 JSR DISPLAY_FAT_NAME +.385f89 4c 38 5f jmp $385f38 JMP RD_SKIP +.385f8c RD_READ_LONG_FILENAME +.385f8c 4c 38 5f jmp $385f38 JMP RD_SKIP +.385f8f STORE_FILE_LIST +.385f8f a0 0b 00 ldy #$000b LDY #11 +.385f92 c9 10 cmp #$10 CMP #$10 +.385f94 f0 02 beq $385f98 BEQ SF_DIR +.385f96 a9 01 lda #$01 LDA #1 +.385f98 SF_DIR +.385f98 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y +.385f9a a0 00 00 ldy #$0000 LDY #0 +.385f9d a2 0b 00 ldx #$000b LDX #11 +.385fa0 SF_LOOP_NAME +.385fa0 b7 80 lda [$80],y LDA [SD_DATA],Y +.385fa2 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y +.385fa4 c8 iny INY +.385fa5 ca dex DEX +.385fa6 d0 f8 bne $385fa0 BNE SF_LOOP_NAME +.385fa8 c2 20 rep #$20 REP #$20 ; set A long +.385faa a0 1a 00 ldy #$001a LDY #fatrec.cluster .385fad b7 80 lda [$80],y LDA [SD_DATA],Y -.385faf a0 0e 00 ldy #$000e LDY #14 +.385faf a0 10 00 ldy #$0010 LDY #16 .385fb2 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y -.385fb4 a5 51 lda $51 LDA SDOS_FILE_REC_PTR -.385fb6 18 clc CLC -.385fb7 69 12 00 adc #$0012 ADC #18 -.385fba 85 51 sta $51 STA SDOS_FILE_REC_PTR -.385fbc e2 20 sep #$20 SEP #$20 ; set A short -.385fbe 60 rts RTS -.385fbf ISDOS_PARSE_ROOT_DIR -.385fbf a5 3f lda $3f LDA SDCARD_PRSNT_MNT -.385fc1 d0 01 bne $385fc4 BNE SP_CARD_PRESENT -.385fc3 6b rtl RTL -.385fc4 SP_CARD_PRESENT -.385fc4 c2 20 rep #$20 REP #$20 ; set A long -.385fc6 a9 00 00 lda #$0000 LDA #0 ; reset the root entries offset -.385fc9 8d 20 5f sta $5f20 STA SD_DIR_OFFSET -.385fcc SP_NEXT_SECTOR -.385fcc a9 00 64 lda #$6400 LDA #SD_ROOT_BEGIN -.385fcf 85 80 sta $80 STA SD_DATA -.385fd1 a9 00 00 lda #$0000 LDA #0 -.385fd4 85 82 sta $82 STA SD_DATA + 2 -.385fd6 ad 20 5f lda $5f20 LDA SD_DIR_OFFSET ; multiply by 512 -.385fd9 0a asl a ASL A -.385fda eb xba XBA -.385fdb 8d 20 01 sta $0120 STA ADDER_A -.385fde a9 00 00 lda #$0000 LDA #0 -.385fe1 8d 22 01 sta $0122 STA ADDER_A + 2 -.385fe4 ad 08 5f lda $5f08 LDA SD_ROOT_OFFSET -.385fe7 8d 24 01 sta $0124 STA ADDER_B -.385fea ad 0a 5f lda $5f0a LDA SD_ROOT_OFFSET+2 -.385fed 8d 26 01 sta $0126 STA ADDER_B + 2 -.385ff0 ad 28 01 lda $0128 LDA ADDER_R -.385ff3 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG -.385ff7 ad 2a 01 lda $012a LDA ADDER_R + 2 -.385ffa 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG -.385ffe e2 20 sep #$20 SEP #$20 ; set A short -.386000 22 d2 5d 38 jsl $385dd2 JSL ISDOS_READ_BLOCK -.386004 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.386008 f0 04 beq $38600e BEQ SP_DIR_ENTRY -.38600a 5c 6a 60 38 jmp $38606a JML SP_DONE -.38600e SP_DIR_ENTRY -.38600e a7 80 lda [$80] LDA [SD_DATA] -.386010 d0 04 bne $386016 BNE SP_CONTINUE ; if first byte is 0, entry is available and there are no following entries -.386012 5c 6a 60 38 jmp $38606a JML SP_DONE -.386016 SP_CONTINUE -.386016 c9 e5 cmp #$e5 CMP #$E5 -.386018 f0 27 beq $386041 BEQ SP_SKIP -.38601a SP_LOOP -.38601a a0 0b 00 ldy #$000b LDY #fatrec.type -.38601d b7 80 lda [$80],y LDA [SD_DATA],Y -.38601f c9 0f cmp #$0f CMP #$F ; long file name -.386021 d0 04 bne $386027 BNE SP_NOT_VFAT -.386023 5c 41 60 38 jmp $386041 JML SP_SKIP -.386027 SP_NOT_VFAT -.386027 89 02 bit #$02 BIT #2 ; hidden -.386029 f0 02 beq $38602d BEQ SP_NOT_HIDDEN -.38602b 80 14 bra $386041 BRA SP_SKIP -.38602d SP_NOT_HIDDEN -.38602d 89 08 bit #$08 BIT #8 ; volume name -.38602f f0 04 beq $386035 BEQ SP_NOT_VOLUME -.386031 5c 41 60 38 jmp $386041 JML SP_SKIP -.386035 SP_NOT_VOLUME -.386035 89 10 bit #$10 BIT #$10 ; directory -.386037 f0 05 beq $38603e BEQ SP_NOT_DIRECTORY -.386039 20 7b 5f jsr $385f7b JSR STORE_FILE_LIST -.38603c 80 03 bra $386041 BRA SP_SKIP -.38603e SP_NOT_DIRECTORY -.38603e 20 7b 5f jsr $385f7b JSR STORE_FILE_LIST -.386041 SP_SKIP -.386041 c2 20 rep #$20 REP #$20 ; set A long -.386043 a5 80 lda $80 LDA SD_DATA -.386045 29 e0 01 and #$01e0 AND #$1E0 ; each record in FAT is $20 bytes long -.386048 c9 e0 01 cmp #$01e0 CMP #$1E0 -.38604b d0 0f bne $38605c BNE SP_SKIP_NEXT -.38604d ad 20 5f lda $5f20 LDA SD_DIR_OFFSET -.386050 1a inc a INC A -.386051 cd 1c 5f cmp $5f1c CMP SD_ROOT_ENTRIES -.386054 b0 14 bcs $38606a BCS SP_DONE -.386056 8d 20 5f sta $5f20 STA SD_DIR_OFFSET ; next sector -.386059 4c cc 5f jmp $385fcc JMP SP_NEXT_SECTOR -.38605c SP_SKIP_NEXT -.38605c a5 80 lda $80 LDA SD_DATA -.38605e 18 clc CLC -.38605f 69 20 00 adc #$0020 ADC #$20 -.386062 85 80 sta $80 STA SD_DATA -.386064 e2 20 sep #$20 SEP #$20 ; set A short -.386066 5c 0e 60 38 jmp $38600e JML SP_DIR_ENTRY -.38606a SP_DONE -.38606a 6b rtl RTL -.38606b ISDOS_READ_FAT_SECTOR -.38606b 48 pha PHA -.38606c a5 3f lda $3f LDA SDCARD_PRSNT_MNT -.38606e 29 ff 00 and #$00ff AND #$FF -.386071 d0 02 bne $386075 BNE RF_CARD_PRESENT -.386073 68 pla PLA -.386074 6b rtl RTL -.386075 RF_CARD_PRESENT -.386075 68 pla PLA -.386076 85 88 sta $88 STA SD_MULT_AREA -.386078 a9 00 00 lda #$0000 LDA #0 -.38607b 85 8a sta $8a STA SD_MULT_AREA + 2 -.38607d 20 d2 5c jsr $385cd2 JSR CALC_OFFSET_BYTES -.386080 a5 88 lda $88 LDA SD_MULT_AREA -.386082 8d 20 01 sta $0120 STA ADDER_A -.386085 a5 8a lda $8a LDA SD_MULT_AREA + 2 -.386087 8d 22 01 sta $0122 STA ADDER_A + 2 -.38608a ad 04 5f lda $5f04 LDA SD_FAT_OFFSET -.38608d 8d 24 01 sta $0124 STA ADDER_B -.386090 ad 06 5f lda $5f06 LDA SD_FAT_OFFSET+2 -.386093 8d 26 01 sta $0126 STA ADDER_B + 2 -.386096 ad 28 01 lda $0128 LDA ADDER_R -.386099 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG -.38609d ad 2a 01 lda $012a LDA ADDER_R + 2 -.3860a0 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG -.3860a4 e2 20 sep #$20 SEP #$20 ; set A short -.3860a6 22 d2 5d 38 jsl $385dd2 JSL ISDOS_READ_BLOCK -.3860aa af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.3860ae f0 08 beq $3860b8 BEQ SD_CONTINUE_FAT -.3860b0 a2 12 63 ldx #$6312 LDX #<>SD_FAT_ERROR_MSG -.3860b3 20 aa 5b jsr $385baa JSR DISPLAY_MSG -.3860b6 80 00 bra $3860b8 BRA SD_CONTINUE_FAT -.3860b8 SD_CONTINUE_FAT -.3860b8 c2 20 rep #$20 REP #$20 ; set A long -.3860ba 6b rtl RTL -.3860bb ISDOS_READ_DATA_CLUSTER -.3860bb 48 pha PHA -.3860bc a5 3f lda $3f LDA SDCARD_PRSNT_MNT -.3860be 29 ff 00 and #$00ff AND #$FF -.3860c1 d0 02 bne $3860c5 BNE SDR_CARD_PRESENT -.3860c3 68 pla PLA -.3860c4 6b rtl RTL -.3860c5 SDR_CARD_PRESENT -.3860c5 68 pla PLA -.3860c6 38 sec SEC -.3860c7 e9 02 00 sbc #$0002 SBC #2 -.3860ca 8d 00 01 sta $0100 STA UNSIGNED_MULT_A -.3860cd ad 24 5f lda $5f24 LDA SD_SECTORS_PER_CLUSTER -.3860d0 8d 02 01 sta $0102 STA UNSIGNED_MULT_B -.3860d3 ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT -.3860d6 48 pha PHA -.3860d7 a2 00 00 ldx #$0000 LDX #0 -.3860da SDR_NEXT_SECTOR -.3860da 85 88 sta $88 STA SD_MULT_AREA -.3860dc a9 00 00 lda #$0000 LDA #0 -.3860df 85 8a sta $8a STA SD_MULT_AREA + 2 -.3860e1 20 d2 5c jsr $385cd2 JSR CALC_OFFSET_BYTES -.3860e4 a5 88 lda $88 LDA SD_MULT_AREA -.3860e6 8d 20 01 sta $0120 STA ADDER_A -.3860e9 a5 8a lda $8a LDA SD_MULT_AREA + 2 -.3860eb 8d 22 01 sta $0122 STA ADDER_A + 2 -.3860ee ad 0c 5f lda $5f0c LDA SD_DATA_OFFSET -.3860f1 8d 24 01 sta $0124 STA ADDER_B -.3860f4 ad 0e 5f lda $5f0e LDA SD_DATA_OFFSET+2 -.3860f7 8d 26 01 sta $0126 STA ADDER_B + 2 -.3860fa ad 28 01 lda $0128 LDA ADDER_R -.3860fd 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG -.386101 ad 2a 01 lda $012a LDA ADDER_R + 2 -.386104 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG -.386108 e2 20 sep #$20 SEP #$20 ; set A short -.38610a 22 d2 5d 38 jsl $385dd2 JSL ISDOS_READ_BLOCK -.38610e af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG -.386112 f0 0a beq $38611e BEQ SD_CONTINUE_DATA -.386114 a9 ff lda #$ff LDA #$FF -.386116 8d 27 5f sta $5f27 STA CLUSTER_PTR -.386119 8d 28 5f sta $5f28 STA CLUSTER_PTR + 1 -.38611c 80 17 bra $386135 BRA SD_CONTINUE_DATA_DONE -.38611e SD_CONTINUE_DATA -.38611e c2 20 rep #$20 REP #$20 ; set A long -.386120 a5 80 lda $80 LDA SD_DATA -.386122 18 clc CLC -.386123 69 00 02 adc #$0200 ADC #$200 -.386126 85 80 sta $80 STA SD_DATA -.386128 90 02 bcc $38612c BCC SD_CONT_NO_CARRY -.38612a e6 82 inc $82 INC SD_DATA + 2 -.38612c SD_CONT_NO_CARRY -.38612c 68 pla PLA -.38612d 1a inc a INC A -.38612e 48 pha PHA -.38612f e8 inx INX -.386130 ec 24 5f cpx $5f24 CPX SD_SECTORS_PER_CLUSTER -.386133 d0 a5 bne $3860da BNE SDR_NEXT_SECTOR -.386135 SD_CONTINUE_DATA_DONE -.386135 c2 20 rep #$20 REP #$20 ; set A long -.386137 68 pla PLA -.386138 6b rtl RTL -.386139 ISDOS_READ_FILE -.386139 48 pha PHA -.38613a a5 3f lda $3f LDA SDCARD_PRSNT_MNT -.38613c 29 ff 00 and #$00ff AND #$FF -.38613f d0 02 bne $386143 BNE SD_CARD_PRESENT -.386141 68 pla PLA -.386142 6b rtl RTL -.386143 SD_CARD_PRESENT -.386143 68 pla PLA -.386144 8d 27 5f sta $5f27 STA CLUSTER_PTR -.386147 SD_CLUSTER_LOOP -.386147 22 bb 60 38 jsl $3860bb JSL ISDOS_READ_DATA_CLUSTER -.38614b ad 26 5f lda $5f26 LDA SD_FAT16 -.38614e 29 01 00 and #$0001 AND #$1 -.386151 0a asl a ASL -.386152 aa tax TAX -.386153 fc 59 61 jsr ($386159,x) JSR (READ_FAT_TABLE,X) -.386156 d0 ef bne $386147 BNE SD_CLUSTER_LOOP -.386158 6b rtl RTL ->386159 5d 61 READ_FAT_TABLE .word <>FAT12_GET_NEXT_CLUSTER ->38615b 82 61 .word <>FAT16_GET_NEXT_CLUSTER -.38615d FAT12_GET_NEXT_CLUSTER -.38615d ad 27 5f lda $5f27 LDA CLUSTER_PTR ; a FAT12 page contains about 340 entries -.386160 4a lsr a LSR A ; this may result in a carry, if the cluster to read is odd -.386161 90 0e bcc $386171 BCC F12_NC_NO_CARRY -.386163 18 clc CLC -.386164 6d 27 5f adc $5f27 ADC CLUSTER_PTR -.386167 a8 tay TAY -.386168 b9 00 66 lda $6600,y LDA FAT_DATA,Y -.38616b 4a lsr a LSR A -.38616c 4a lsr a LSR A -.38616d 4a lsr a LSR A -.38616e 4a lsr a LSR A ; divide by 16 -.38616f 80 0a bra $38617b BRA F12_NC_CONTINUE -.386171 F12_NC_NO_CARRY -.386171 6d 27 5f adc $5f27 ADC CLUSTER_PTR -.386174 a8 tay TAY -.386175 b9 00 66 lda $6600,y LDA FAT_DATA,Y -.386178 29 ff 0f and #$0fff AND #$FFF -.38617b F12_NC_CONTINUE -.38617b 8d 27 5f sta $5f27 STA CLUSTER_PTR -.38617e c9 ff 0f cmp #$0fff CMP #$FFF -.386181 60 rts RTS -.386182 FAT16_GET_NEXT_CLUSTER -.386182 ad 27 5f lda $5f27 LDA CLUSTER_PTR -.386185 eb xba XBA -.386186 29 ff 00 and #$00ff AND #$FF -.386189 c5 86 cmp $86 CMP SD_DATA_FAT_PAGE -.38618b f0 22 beq $3861af BEQ SKIP_FAT_LOADING -.38618d 48 pha PHA -.38618e a5 80 lda $80 LDA SD_DATA -.386190 85 83 sta $83 STA SD_TMP_DATA -.386192 a5 82 lda $82 LDA SD_DATA + 2 -.386194 85 85 sta $85 STA SD_TMP_DATA + 2 -.386196 a9 00 66 lda #$6600 LDA #FAT_DATA -.386199 85 80 sta $80 STA SD_DATA -.38619b a9 00 00 lda #$0000 LDA #0 -.38619e 85 82 sta $82 STA SD_DATA + 2 -.3861a0 68 pla PLA -.3861a1 85 86 sta $86 STA SD_DATA_FAT_PAGE -.3861a3 22 6b 60 38 jsl $38606b JSL ISDOS_READ_FAT_SECTOR -.3861a7 a5 83 lda $83 LDA SD_TMP_DATA -.3861a9 85 80 sta $80 STA SD_DATA -.3861ab a5 85 lda $85 LDA SD_TMP_DATA + 2 -.3861ad 85 82 sta $82 STA SD_DATA + 2 -.3861af SKIP_FAT_LOADING -.3861af ad 27 5f lda $5f27 LDA CLUSTER_PTR -.3861b2 29 ff 00 and #$00ff AND #$FF -.3861b5 0a asl a ASL A ; multiply by 2 -.3861b6 a8 tay TAY -.3861b7 b9 00 66 lda $6600,y LDA FAT_DATA,Y -.3861ba 8d 27 5f sta $5f27 STA CLUSTER_PTR -.3861bd c9 ff ff cmp #$ffff CMP #$FFFF -.3861c0 60 rts RTS -.3861c1 COMPUTE_FAT_ROOT_DATA_OFFSETS -.3861c1 ad 10 5f lda $5f10 LDA SD_RESERVED_SECTORS ; 16 bit value -.3861c4 85 88 sta $88 STA SD_MULT_AREA -.3861c6 a9 00 00 lda #$0000 LDA #0 -.3861c9 85 8a sta $8a STA SD_MULT_AREA + 2 -.3861cb 20 d2 5c jsr $385cd2 JSR CALC_OFFSET_BYTES ; compute the byte offset -.3861ce a5 88 lda $88 LDA SD_MULT_AREA -.3861d0 8d 20 01 sta $0120 STA ADDER_A -.3861d3 a5 8a lda $8a LDA SD_MULT_AREA + 2 -.3861d5 8d 22 01 sta $0122 STA ADDER_A+2 -.3861d8 ad 00 5f lda $5f00 LDA SD_FIRST_SECTOR ; 32 bit value -.3861db 8d 24 01 sta $0124 STA ADDER_B -.3861de ad 02 5f lda $5f02 LDA SD_FIRST_SECTOR + 2 -.3861e1 8d 26 01 sta $0126 STA ADDER_B + 2 -.3861e4 ad 28 01 lda $0128 LDA ADDER_R -.3861e7 8d 04 5f sta $5f04 STA SD_FAT_OFFSET -.3861ea ad 2a 01 lda $012a LDA ADDER_R + 2 -.3861ed 8d 06 5f sta $5f06 STA SD_FAT_OFFSET + 2 -.3861f0 ad 16 5f lda $5f16 LDA SD_FAT_COUNT -.3861f3 8d 00 01 sta $0100 STA UNSIGNED_MULT_A -.3861f6 ad 12 5f lda $5f12 LDA SD_SECTORS_PER_FAT -.3861f9 8d 02 01 sta $0102 STA UNSIGNED_MULT_B -.3861fc ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT -.3861ff 85 88 sta $88 STA SD_MULT_AREA -.386201 ad 06 01 lda $0106 LDA UNSIGNED_MULT_RESULT + 2 -.386204 85 8a sta $8a STA SD_MULT_AREA + 2 -.386206 20 d2 5c jsr $385cd2 JSR CALC_OFFSET_BYTES ; compute the byte offset -.386209 a5 88 lda $88 LDA SD_MULT_AREA -.38620b 8d 20 01 sta $0120 STA ADDER_A -.38620e a5 8a lda $8a LDA SD_MULT_AREA + 2 -.386210 8d 22 01 sta $0122 STA ADDER_A + 2 -.386213 ad 04 5f lda $5f04 LDA SD_FAT_OFFSET -.386216 8d 24 01 sta $0124 STA ADDER_B -.386219 ad 06 5f lda $5f06 LDA SD_FAT_OFFSET + 2 -.38621c 8d 26 01 sta $0126 STA ADDER_B +2 -.38621f ad 28 01 lda $0128 LDA ADDER_R -.386222 8d 08 5f sta $5f08 STA SD_ROOT_OFFSET -.386225 ad 2a 01 lda $012a LDA ADDER_R +2 -.386228 8d 0a 5f sta $5f0a STA SD_ROOT_OFFSET + 2 -.38622b ad 08 5f lda $5f08 LDA SD_ROOT_OFFSET -.38622e 8d 20 01 sta $0120 STA ADDER_A -.386231 ad 0a 5f lda $5f0a LDA SD_ROOT_OFFSET + 2 -.386234 8d 22 01 sta $0122 STA ADDER_A + 2 -.386237 a9 20 00 lda #$0020 LDA #32 ; the root contains 512 entries at 32 bytes each -.38623a 85 88 sta $88 STA SD_MULT_AREA -.38623c a9 00 00 lda #$0000 LDA #0 -.38623f 85 8a sta $8a STA SD_MULT_AREA + 2 -.386241 20 d2 5c jsr $385cd2 JSR CALC_OFFSET_BYTES -.386244 a5 88 lda $88 LDA SD_MULT_AREA -.386246 8d 24 01 sta $0124 STA ADDER_B -.386249 a5 8a lda $8a LDA SD_MULT_AREA + 2 -.38624b 8d 26 01 sta $0126 STA ADDER_B + 2 -.38624e ad 28 01 lda $0128 LDA ADDER_R -.386251 8d 0c 5f sta $5f0c STA SD_DATA_OFFSET -.386254 ad 2a 01 lda $012a LDA ADDER_R + 2 -.386257 8d 0e 5f sta $5f0e STA SD_DATA_OFFSET + 2 -.38625a 60 rts RTS ->38625b 30 30 20 2d 20 57 65 6c sd_card_tester .text "00 - Welcome to the SDCard Tester", $d, 0 ->386263 63 6f 6d 65 20 74 6f 20 74 68 65 20 53 44 43 61 ->386273 72 64 20 54 65 73 74 65 72 0d 00 ->38627e 30 31 20 2d 20 43 61 72 sd_card_present_msg .text "01 - Card Present", $d, 0 ->386286 64 20 50 72 65 73 65 6e 74 0d 00 ->386291 30 31 20 2d 20 4e 4f 20 sd_no_card_msg .text "01 - NO SDCARD PRESENT", $0D, $00 ->386299 53 44 43 41 52 44 20 50 52 45 53 45 4e 54 0d 00 ->3862a9 30 32 20 2d 20 43 61 6e sd_cant_read_mbr_msg .text "02 - Can't read MBR - No Card present", $D, $0 ->3862b1 27 74 20 72 65 61 64 20 4d 42 52 20 2d 20 4e 6f ->3862c1 20 43 61 72 64 20 70 72 65 73 65 6e 74 0d 00 ->3862d0 30 33 20 2d 20 45 72 72 sd_read_failure .text "03 - Error during read operation", $d, $0 ->3862d8 6f 72 20 64 75 72 69 6e 67 20 72 65 61 64 20 6f ->3862e8 70 65 72 61 74 69 6f 6e 0d 00 ->3862f2 30 34 20 2d 20 45 72 72 SD_BOOT_SECTOR_MSG .text "04 - Error reading Boot sector", $d, $0 ->3862fa 6f 72 20 72 65 61 64 69 6e 67 20 42 6f 6f 74 20 ->38630a 73 65 63 74 6f 72 0d 00 ->386312 30 35 20 2d 20 45 72 72 SD_FAT_ERROR_MSG .text "05 - Error reading FAT sector", $d, $0 ->38631a 6f 72 20 72 65 61 64 69 6e 67 20 46 41 54 20 73 ->38632a 65 63 74 6f 72 0d 00 ->386331 30 35 20 2d 20 45 72 72 SD_ROOT_ERROR_MSG .text "05 - Error reading Root sector", $d, $0 ->386339 6f 72 20 72 65 61 64 69 6e 67 20 52 6f 6f 74 20 ->386349 73 65 63 74 6f 72 0d 00 ->386351 30 35 20 2d 20 45 72 72 SD_DATA_ERROR_MSG .text "05 - Error reading Data sector", $d, $0 ->386359 6f 72 20 72 65 61 64 69 6e 67 20 44 61 74 61 20 ->386369 73 65 63 74 6f 72 0d 00 ->386371 49 6e 76 61 6c 69 64 20 INVALID_SIG_MSG .text 'Invalid MBR Signature',$D,0 ->386379 4d 42 52 20 53 69 67 6e 61 74 75 72 65 0d 00 ->386388 56 6f 6c 75 6d 65 20 4e sd_volume_name .text "Volume Name: ", $0 ->386390 61 6d 65 3a 20 00 ->386396 56 46 41 54 20 4e 61 6d sd_vfat_name .text "VFAT Name : ", $0 ->38639e 65 20 20 3a 20 00 ->3863a4 44 69 72 65 63 74 6f 72 sd_dir_name .text "Directory : ", $0 ->3863ac 79 20 20 3a 20 00 ->3863b2 46 69 6c 65 6e 61 6d 65 sd_filename .text "Filename : ", $0 ->3863ba 20 20 20 3a 20 00 ->3863c0 2c 20 43 6c 75 73 74 65 sd_cluster_str .text ", Cluster:", $0 ->3863c8 72 3a 00 ->3863cb 2c 20 53 69 7a 65 3a 00 sd_filesize_str .text ", Size:", $0 +.385fb4 a0 1c 00 ldy #$001c LDY #fatrec.size_l +.385fb7 b7 80 lda [$80],y LDA [SD_DATA],Y +.385fb9 a0 0c 00 ldy #$000c LDY #12 +.385fbc 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y +.385fbe a0 1e 00 ldy #$001e LDY #fatrec.size_h +.385fc1 b7 80 lda [$80],y LDA [SD_DATA],Y +.385fc3 a0 0e 00 ldy #$000e LDY #14 +.385fc6 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR],Y +.385fc8 a5 51 lda $51 LDA SDOS_FILE_REC_PTR +.385fca 18 clc CLC +.385fcb 69 12 00 adc #$0012 ADC #18 +.385fce 85 51 sta $51 STA SDOS_FILE_REC_PTR +.385fd0 e2 20 sep #$20 SEP #$20 ; set A short +.385fd2 60 rts RTS +.385fd3 ISDOS_PARSE_ROOT_DIR +.385fd3 a5 3f lda $3f LDA SDCARD_PRSNT_MNT +.385fd5 d0 01 bne $385fd8 BNE SP_CARD_PRESENT +.385fd7 6b rtl RTL +.385fd8 SP_CARD_PRESENT +.385fd8 c2 20 rep #$20 REP #$20 ; set A long +.385fda a9 00 00 lda #$0000 LDA #0 ; reset the root entries offset +.385fdd 8d 20 5f sta $5f20 STA SD_DIR_OFFSET +.385fe0 SP_NEXT_SECTOR +.385fe0 a9 00 64 lda #$6400 LDA #SD_ROOT_BEGIN +.385fe3 85 80 sta $80 STA SD_DATA +.385fe5 a9 00 00 lda #$0000 LDA #0 +.385fe8 85 82 sta $82 STA SD_DATA + 2 +.385fea ad 20 5f lda $5f20 LDA SD_DIR_OFFSET ; multiply by 512 +.385fed 0a asl a ASL A +.385fee eb xba XBA +.385fef 8d 20 01 sta $0120 STA ADDER_A +.385ff2 a9 00 00 lda #$0000 LDA #0 +.385ff5 8d 22 01 sta $0122 STA ADDER_A + 2 +.385ff8 ad 08 5f lda $5f08 LDA SD_ROOT_OFFSET +.385ffb 8d 24 01 sta $0124 STA ADDER_B +.385ffe ad 0a 5f lda $5f0a LDA SD_ROOT_OFFSET+2 +.386001 8d 26 01 sta $0126 STA ADDER_B + 2 +.386004 ad 28 01 lda $0128 LDA ADDER_R +.386007 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG +.38600b ad 2a 01 lda $012a LDA ADDER_R + 2 +.38600e 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG +.386012 e2 20 sep #$20 SEP #$20 ; set A short +.386014 22 e6 5d 38 jsl $385de6 JSL ISDOS_READ_BLOCK +.386018 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.38601c f0 04 beq $386022 BEQ SP_DIR_ENTRY +.38601e 5c 7e 60 38 jmp $38607e JML SP_DONE +.386022 SP_DIR_ENTRY +.386022 a7 80 lda [$80] LDA [SD_DATA] +.386024 d0 04 bne $38602a BNE SP_CONTINUE ; if first byte is 0, entry is available and there are no following entries +.386026 5c 7e 60 38 jmp $38607e JML SP_DONE +.38602a SP_CONTINUE +.38602a c9 e5 cmp #$e5 CMP #$E5 +.38602c f0 27 beq $386055 BEQ SP_SKIP +.38602e SP_LOOP +.38602e a0 0b 00 ldy #$000b LDY #fatrec.type +.386031 b7 80 lda [$80],y LDA [SD_DATA],Y +.386033 c9 0f cmp #$0f CMP #$F ; long file name +.386035 d0 04 bne $38603b BNE SP_NOT_VFAT +.386037 5c 55 60 38 jmp $386055 JML SP_SKIP +.38603b SP_NOT_VFAT +.38603b 89 02 bit #$02 BIT #2 ; hidden +.38603d f0 02 beq $386041 BEQ SP_NOT_HIDDEN +.38603f 80 14 bra $386055 BRA SP_SKIP +.386041 SP_NOT_HIDDEN +.386041 89 08 bit #$08 BIT #8 ; volume name +.386043 f0 04 beq $386049 BEQ SP_NOT_VOLUME +.386045 5c 55 60 38 jmp $386055 JML SP_SKIP +.386049 SP_NOT_VOLUME +.386049 89 10 bit #$10 BIT #$10 ; directory +.38604b f0 05 beq $386052 BEQ SP_NOT_DIRECTORY +.38604d 20 8f 5f jsr $385f8f JSR STORE_FILE_LIST +.386050 80 03 bra $386055 BRA SP_SKIP +.386052 SP_NOT_DIRECTORY +.386052 20 8f 5f jsr $385f8f JSR STORE_FILE_LIST +.386055 SP_SKIP +.386055 c2 20 rep #$20 REP #$20 ; set A long +.386057 a5 80 lda $80 LDA SD_DATA +.386059 29 e0 01 and #$01e0 AND #$1E0 ; each record in FAT is $20 bytes long +.38605c c9 e0 01 cmp #$01e0 CMP #$1E0 +.38605f d0 0f bne $386070 BNE SP_SKIP_NEXT +.386061 ad 20 5f lda $5f20 LDA SD_DIR_OFFSET +.386064 1a inc a INC A +.386065 cd 1e 5f cmp $5f1e CMP SD_ROOT_ENTRIES +.386068 b0 14 bcs $38607e BCS SP_DONE +.38606a 8d 20 5f sta $5f20 STA SD_DIR_OFFSET ; next sector +.38606d 4c e0 5f jmp $385fe0 JMP SP_NEXT_SECTOR +.386070 SP_SKIP_NEXT +.386070 a5 80 lda $80 LDA SD_DATA +.386072 18 clc CLC +.386073 69 20 00 adc #$0020 ADC #$20 +.386076 85 80 sta $80 STA SD_DATA +.386078 e2 20 sep #$20 SEP #$20 ; set A short +.38607a 5c 22 60 38 jmp $386022 JML SP_DIR_ENTRY +.38607e SP_DONE +.38607e 6b rtl RTL +.38607f ISDOS_READ_FAT_SECTOR +.38607f 48 pha PHA +.386080 a5 3f lda $3f LDA SDCARD_PRSNT_MNT +.386082 29 ff 00 and #$00ff AND #$FF +.386085 d0 02 bne $386089 BNE RF_CARD_PRESENT +.386087 68 pla PLA +.386088 6b rtl RTL +.386089 RF_CARD_PRESENT +.386089 68 pla PLA +.38608a 85 88 sta $88 STA SD_MULT_AREA +.38608c a9 00 00 lda #$0000 LDA #0 +.38608f 85 8a sta $8a STA SD_MULT_AREA + 2 +.386091 20 c1 5c jsr $385cc1 JSR CALC_OFFSET_BYTES +.386094 a5 88 lda $88 LDA SD_MULT_AREA +.386096 8d 20 01 sta $0120 STA ADDER_A +.386099 a5 8a lda $8a LDA SD_MULT_AREA + 2 +.38609b 8d 22 01 sta $0122 STA ADDER_A + 2 +.38609e ad 04 5f lda $5f04 LDA SD_FAT_OFFSET +.3860a1 8d 24 01 sta $0124 STA ADDER_B +.3860a4 ad 06 5f lda $5f06 LDA SD_FAT_OFFSET+2 +.3860a7 8d 26 01 sta $0126 STA ADDER_B + 2 +.3860aa ad 28 01 lda $0128 LDA ADDER_R +.3860ad 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG +.3860b1 ad 2a 01 lda $012a LDA ADDER_R + 2 +.3860b4 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG +.3860b8 e2 20 sep #$20 SEP #$20 ; set A short +.3860ba 22 e6 5d 38 jsl $385de6 JSL ISDOS_READ_BLOCK +.3860be af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.3860c2 f0 08 beq $3860cc BEQ SD_CONTINUE_FAT +.3860c4 a2 7a 63 ldx #$637a LDX #<>SD_FAT_ERROR_MSG +.3860c7 20 9c 5b jsr $385b9c JSR DISPLAY_MSG +.3860ca 80 00 bra $3860cc BRA SD_CONTINUE_FAT +.3860cc SD_CONTINUE_FAT +.3860cc c2 20 rep #$20 REP #$20 ; set A long +.3860ce 6b rtl RTL +.3860cf ISDOS_READ_DATA_CLUSTER +.3860cf 48 pha PHA +.3860d0 a5 3f lda $3f LDA SDCARD_PRSNT_MNT +.3860d2 29 ff 00 and #$00ff AND #$FF +.3860d5 d0 02 bne $3860d9 BNE SDR_CARD_PRESENT +.3860d7 68 pla PLA +.3860d8 6b rtl RTL +.3860d9 SDR_CARD_PRESENT +.3860d9 ad 26 5f lda $5f26 LDA SD_FAT16_32 +.3860dc 29 03 00 and #$0003 AND #3 +.3860df c9 02 00 cmp #$0002 CMP #2 +.3860e2 f0 07 beq $3860eb BEQ SDR_FAT32 +.3860e4 68 pla PLA +.3860e5 38 sec SEC +.3860e6 e9 02 00 sbc #$0002 SBC #2 +.3860e9 80 05 bra $3860f0 BRA SDR_FAT_ADJ_CONTINUE +.3860eb SDR_FAT32 +.3860eb 68 pla PLA +.3860ec 38 sec SEC +.3860ed e9 06 00 sbc #$0006 SBC #6 +.3860f0 SDR_FAT_ADJ_CONTINUE +.3860f0 8d 00 01 sta $0100 STA UNSIGNED_MULT_A +.3860f3 ad 24 5f lda $5f24 LDA SD_SECTORS_PER_CLUSTER +.3860f6 8d 02 01 sta $0102 STA UNSIGNED_MULT_B +.3860f9 ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT +.3860fc 48 pha PHA +.3860fd a2 00 00 ldx #$0000 LDX #0 +.386100 SDR_NEXT_SECTOR +.386100 85 88 sta $88 STA SD_MULT_AREA +.386102 a9 00 00 lda #$0000 LDA #0 +.386105 85 8a sta $8a STA SD_MULT_AREA + 2 +.386107 20 c1 5c jsr $385cc1 JSR CALC_OFFSET_BYTES +.38610a a5 88 lda $88 LDA SD_MULT_AREA +.38610c 8d 20 01 sta $0120 STA ADDER_A +.38610f a5 8a lda $8a LDA SD_MULT_AREA + 2 +.386111 8d 22 01 sta $0122 STA ADDER_A + 2 +.386114 ad 0c 5f lda $5f0c LDA SD_DATA_OFFSET +.386117 8d 24 01 sta $0124 STA ADDER_B +.38611a ad 0e 5f lda $5f0e LDA SD_DATA_OFFSET+2 +.38611d 8d 26 01 sta $0126 STA ADDER_B + 2 +.386120 ad 28 01 lda $0128 LDA ADDER_R +.386123 8f 07 ea af sta $afea07 STA SDC_SD_ADDR_7_0_REG +.386127 ad 2a 01 lda $012a LDA ADDER_R + 2 +.38612a 8f 09 ea af sta $afea09 STA SDC_SD_ADDR_23_16_REG +.38612e e2 20 sep #$20 SEP #$20 ; set A short +.386130 22 e6 5d 38 jsl $385de6 JSL ISDOS_READ_BLOCK +.386134 af 05 ea af lda $afea05 LDA SDC_TRANS_ERROR_REG +.386138 f0 0a beq $386144 BEQ SD_CONTINUE_DATA +.38613a a9 ff lda #$ff LDA #$FF +.38613c 8d 27 5f sta $5f27 STA CLUSTER_PTR +.38613f 8d 28 5f sta $5f28 STA CLUSTER_PTR + 1 +.386142 80 17 bra $38615b BRA SD_CONTINUE_DATA_DONE +.386144 SD_CONTINUE_DATA +.386144 c2 20 rep #$20 REP #$20 ; set A long +.386146 a5 80 lda $80 LDA SD_DATA +.386148 18 clc CLC +.386149 69 00 02 adc #$0200 ADC #$200 +.38614c 85 80 sta $80 STA SD_DATA +.38614e 90 02 bcc $386152 BCC SD_CONT_NO_CARRY +.386150 e6 82 inc $82 INC SD_DATA + 2 +.386152 SD_CONT_NO_CARRY +.386152 68 pla PLA +.386153 1a inc a INC A +.386154 48 pha PHA +.386155 e8 inx INX +.386156 ec 24 5f cpx $5f24 CPX SD_SECTORS_PER_CLUSTER +.386159 d0 a5 bne $386100 BNE SDR_NEXT_SECTOR +.38615b SD_CONTINUE_DATA_DONE +.38615b c2 20 rep #$20 REP #$20 ; set A long +.38615d 68 pla PLA +.38615e 6b rtl RTL +.38615f ISDOS_READ_FILE +.38615f 48 pha PHA +.386160 a5 3f lda $3f LDA SDCARD_PRSNT_MNT +.386162 29 ff 00 and #$00ff AND #$FF +.386165 d0 02 bne $386169 BNE SD_CARD_PRESENT +.386167 68 pla PLA +.386168 6b rtl RTL +.386169 SD_CARD_PRESENT +.386169 68 pla PLA +.38616a 8d 27 5f sta $5f27 STA CLUSTER_PTR +.38616d SD_CLUSTER_LOOP +.38616d 22 cf 60 38 jsl $3860cf JSL ISDOS_READ_DATA_CLUSTER +.386171 ad 26 5f lda $5f26 LDA SD_FAT16_32 +.386174 29 03 00 and #$0003 AND #$3 +.386177 0a asl a ASL +.386178 aa tax TAX +.386179 fc 7f 61 jsr ($38617f,x) JSR (READ_FAT_TABLE,X) +.38617c d0 ef bne $38616d BNE SD_CLUSTER_LOOP +.38617e 6b rtl RTL +>38617f 85 61 READ_FAT_TABLE .word <>FAT12_GET_NEXT_CLUSTER +>386181 aa 61 .word <>FAT16_GET_NEXT_CLUSTER +>386183 e9 61 .word <>FAT32_GET_NEXT_CLUSTER +.386185 FAT12_GET_NEXT_CLUSTER +.386185 ad 27 5f lda $5f27 LDA CLUSTER_PTR ; a FAT12 page contains about 340 entries +.386188 4a lsr a LSR A ; this may result in a carry, if the cluster to read is odd +.386189 90 0e bcc $386199 BCC F12_NC_NO_CARRY +.38618b 18 clc CLC +.38618c 6d 27 5f adc $5f27 ADC CLUSTER_PTR +.38618f a8 tay TAY +.386190 b9 00 66 lda $6600,y LDA FAT_DATA,Y +.386193 4a lsr a LSR A +.386194 4a lsr a LSR A +.386195 4a lsr a LSR A +.386196 4a lsr a LSR A ; divide by 16 +.386197 80 0a bra $3861a3 BRA F12_NC_CONTINUE +.386199 F12_NC_NO_CARRY +.386199 6d 27 5f adc $5f27 ADC CLUSTER_PTR +.38619c a8 tay TAY +.38619d b9 00 66 lda $6600,y LDA FAT_DATA,Y +.3861a0 29 ff 0f and #$0fff AND #$FFF +.3861a3 F12_NC_CONTINUE +.3861a3 8d 27 5f sta $5f27 STA CLUSTER_PTR +.3861a6 c9 ff 0f cmp #$0fff CMP #$FFF +.3861a9 60 rts RTS +.3861aa FAT16_GET_NEXT_CLUSTER +.3861aa ad 27 5f lda $5f27 LDA CLUSTER_PTR +.3861ad eb xba XBA +.3861ae 29 ff 00 and #$00ff AND #$FF +.3861b1 c5 86 cmp $86 CMP SD_DATA_FAT_PAGE +.3861b3 f0 22 beq $3861d7 BEQ SKIP_FAT16_LOADING +.3861b5 48 pha PHA +.3861b6 a5 80 lda $80 LDA SD_DATA +.3861b8 85 83 sta $83 STA SD_TMP_DATA +.3861ba a5 82 lda $82 LDA SD_DATA + 2 +.3861bc 85 85 sta $85 STA SD_TMP_DATA + 2 +.3861be a9 00 66 lda #$6600 LDA #FAT_DATA +.3861c1 85 80 sta $80 STA SD_DATA +.3861c3 a9 00 00 lda #$0000 LDA #0 +.3861c6 85 82 sta $82 STA SD_DATA + 2 +.3861c8 68 pla PLA +.3861c9 85 86 sta $86 STA SD_DATA_FAT_PAGE +.3861cb 22 7f 60 38 jsl $38607f JSL ISDOS_READ_FAT_SECTOR +.3861cf a5 83 lda $83 LDA SD_TMP_DATA +.3861d1 85 80 sta $80 STA SD_DATA +.3861d3 a5 85 lda $85 LDA SD_TMP_DATA + 2 +.3861d5 85 82 sta $82 STA SD_DATA + 2 +.3861d7 SKIP_FAT16_LOADING +.3861d7 ad 27 5f lda $5f27 LDA CLUSTER_PTR +.3861da 29 ff 00 and #$00ff AND #$FF +.3861dd 0a asl a ASL A ; multiply by 2 +.3861de a8 tay TAY +.3861df b9 00 66 lda $6600,y LDA FAT_DATA,Y +.3861e2 8d 27 5f sta $5f27 STA CLUSTER_PTR +.3861e5 c9 ff ff cmp #$ffff CMP #$FFFF ; the branch instruction occurs upon return +.3861e8 60 rts RTS +.3861e9 FAT32_GET_NEXT_CLUSTER +.3861e9 ad 27 5f lda $5f27 LDA CLUSTER_PTR +.3861ec eb xba XBA +.3861ed 29 ff 00 and #$00ff AND #$FF +.3861f0 c5 86 cmp $86 CMP SD_DATA_FAT_PAGE +.3861f2 f0 22 beq $386216 BEQ SKIP_FAT32_LOADING +.3861f4 48 pha PHA +.3861f5 a5 80 lda $80 LDA SD_DATA +.3861f7 85 83 sta $83 STA SD_TMP_DATA +.3861f9 a5 82 lda $82 LDA SD_DATA + 2 +.3861fb 85 85 sta $85 STA SD_TMP_DATA + 2 +.3861fd a9 00 66 lda #$6600 LDA #FAT_DATA +.386200 85 80 sta $80 STA SD_DATA +.386202 a9 00 00 lda #$0000 LDA #0 +.386205 85 82 sta $82 STA SD_DATA + 2 +.386207 68 pla PLA +.386208 85 86 sta $86 STA SD_DATA_FAT_PAGE +.38620a 22 7f 60 38 jsl $38607f JSL ISDOS_READ_FAT_SECTOR +.38620e a5 83 lda $83 LDA SD_TMP_DATA +.386210 85 80 sta $80 STA SD_DATA +.386212 a5 85 lda $85 LDA SD_TMP_DATA + 2 +.386214 85 82 sta $82 STA SD_DATA + 2 +.386216 SKIP_FAT32_LOADING +.386216 ad 27 5f lda $5f27 LDA CLUSTER_PTR +.386219 29 ff 00 and #$00ff AND #$FF +.38621c 0a asl a ASL A ; multiply by 4 +.38621d 0a asl a ASL A +.38621e a8 tay TAY +.38621f b9 00 66 lda $6600,y LDA FAT_DATA,Y ; check for end of file +.386222 8d 27 5f sta $5f27 STA CLUSTER_PTR +.386225 c9 ff ff cmp #$ffff CMP #$FFFF ; the branch instruction occurs upon return +.386228 60 rts RTS +.386229 COMPUTE_FAT_ROOT_DATA_OFFSETS +.386229 ad 10 5f lda $5f10 LDA SD_RESERVED_SECTORS ; 16 bit value +.38622c 85 88 sta $88 STA SD_MULT_AREA +.38622e a9 00 00 lda #$0000 LDA #0 +.386231 85 8a sta $8a STA SD_MULT_AREA + 2 +.386233 20 c1 5c jsr $385cc1 JSR CALC_OFFSET_BYTES ; compute the byte offset +.386236 a5 88 lda $88 LDA SD_MULT_AREA +.386238 8d 20 01 sta $0120 STA ADDER_A +.38623b a5 8a lda $8a LDA SD_MULT_AREA + 2 +.38623d 8d 22 01 sta $0122 STA ADDER_A+2 +.386240 ad 00 5f lda $5f00 LDA SD_FIRST_SECTOR ; 32 bit value +.386243 8d 24 01 sta $0124 STA ADDER_B +.386246 ad 02 5f lda $5f02 LDA SD_FIRST_SECTOR + 2 +.386249 8d 26 01 sta $0126 STA ADDER_B + 2 +.38624c ad 28 01 lda $0128 LDA ADDER_R +.38624f 8d 04 5f sta $5f04 STA SD_FAT_OFFSET +.386252 ad 2a 01 lda $012a LDA ADDER_R + 2 +.386255 8d 06 5f sta $5f06 STA SD_FAT_OFFSET + 2 +.386258 ad 18 5f lda $5f18 LDA SD_FAT_COUNT +.38625b 8d 00 01 sta $0100 STA UNSIGNED_MULT_A +.38625e ad 12 5f lda $5f12 LDA SD_SECTORS_PER_FAT +.386261 8d 02 01 sta $0102 STA UNSIGNED_MULT_B +.386264 ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT +.386267 85 88 sta $88 STA SD_MULT_AREA +.386269 ad 06 01 lda $0106 LDA UNSIGNED_MULT_RESULT + 2 +.38626c 85 8a sta $8a STA SD_MULT_AREA + 2 +.38626e 20 c1 5c jsr $385cc1 JSR CALC_OFFSET_BYTES ; compute the byte offset +.386271 a5 88 lda $88 LDA SD_MULT_AREA +.386273 8d 20 01 sta $0120 STA ADDER_A +.386276 a5 8a lda $8a LDA SD_MULT_AREA + 2 +.386278 8d 22 01 sta $0122 STA ADDER_A + 2 +.38627b ad 04 5f lda $5f04 LDA SD_FAT_OFFSET +.38627e 8d 24 01 sta $0124 STA ADDER_B +.386281 ad 06 5f lda $5f06 LDA SD_FAT_OFFSET + 2 +.386284 8d 26 01 sta $0126 STA ADDER_B +2 +.386287 ad 28 01 lda $0128 LDA ADDER_R +.38628a 8d 08 5f sta $5f08 STA SD_ROOT_OFFSET +.38628d ad 2a 01 lda $012a LDA ADDER_R +2 +.386290 8d 0a 5f sta $5f0a STA SD_ROOT_OFFSET + 2 +.386293 ad 08 5f lda $5f08 LDA SD_ROOT_OFFSET +.386296 8d 20 01 sta $0120 STA ADDER_A +.386299 ad 0a 5f lda $5f0a LDA SD_ROOT_OFFSET + 2 +.38629c 8d 22 01 sta $0122 STA ADDER_A + 2 +.38629f a9 20 00 lda #$0020 LDA #32 ; the root contains 512 entries at 32 bytes each +.3862a2 85 88 sta $88 STA SD_MULT_AREA +.3862a4 a9 00 00 lda #$0000 LDA #0 +.3862a7 85 8a sta $8a STA SD_MULT_AREA + 2 +.3862a9 20 c1 5c jsr $385cc1 JSR CALC_OFFSET_BYTES +.3862ac a5 88 lda $88 LDA SD_MULT_AREA +.3862ae 8d 24 01 sta $0124 STA ADDER_B +.3862b1 a5 8a lda $8a LDA SD_MULT_AREA + 2 +.3862b3 8d 26 01 sta $0126 STA ADDER_B + 2 +.3862b6 ad 28 01 lda $0128 LDA ADDER_R +.3862b9 8d 0c 5f sta $5f0c STA SD_DATA_OFFSET +.3862bc ad 2a 01 lda $012a LDA ADDER_R + 2 +.3862bf 8d 0e 5f sta $5f0e STA SD_DATA_OFFSET + 2 +.3862c2 60 rts RTS +>3862c3 30 30 20 2d 20 57 65 6c sd_card_tester .text "00 - Welcome to the SDCard Tester", $d, 0 +>3862cb 63 6f 6d 65 20 74 6f 20 74 68 65 20 53 44 43 61 +>3862db 72 64 20 54 65 73 74 65 72 0d 00 +>3862e6 30 31 20 2d 20 43 61 72 sd_card_present_msg .text "01 - Card Present", $d, 0 +>3862ee 64 20 50 72 65 73 65 6e 74 0d 00 +>3862f9 30 31 20 2d 20 4e 4f 20 sd_no_card_msg .text "01 - NO SDCARD PRESENT", $0D, $00 +>386301 53 44 43 41 52 44 20 50 52 45 53 45 4e 54 0d 00 +>386311 30 32 20 2d 20 43 61 6e sd_cant_read_mbr_msg .text "02 - Can't read MBR - No Card present", $D, $0 +>386319 27 74 20 72 65 61 64 20 4d 42 52 20 2d 20 4e 6f +>386329 20 43 61 72 64 20 70 72 65 73 65 6e 74 0d 00 +>386338 30 33 20 2d 20 45 72 72 sd_read_failure .text "03 - Error during read operation", $d, $0 +>386340 6f 72 20 64 75 72 69 6e 67 20 72 65 61 64 20 6f +>386350 70 65 72 61 74 69 6f 6e 0d 00 +>38635a 30 34 20 2d 20 45 72 72 SD_BOOT_SECTOR_MSG .text "04 - Error reading Boot sector", $d, $0 +>386362 6f 72 20 72 65 61 64 69 6e 67 20 42 6f 6f 74 20 +>386372 73 65 63 74 6f 72 0d 00 +>38637a 30 35 20 2d 20 45 72 72 SD_FAT_ERROR_MSG .text "05 - Error reading FAT sector", $d, $0 +>386382 6f 72 20 72 65 61 64 69 6e 67 20 46 41 54 20 73 +>386392 65 63 74 6f 72 0d 00 +>386399 30 35 20 2d 20 45 72 72 SD_ROOT_ERROR_MSG .text "05 - Error reading Root sector", $d, $0 +>3863a1 6f 72 20 72 65 61 64 69 6e 67 20 52 6f 6f 74 20 +>3863b1 73 65 63 74 6f 72 0d 00 +>3863b9 30 35 20 2d 20 45 72 72 SD_DATA_ERROR_MSG .text "05 - Error reading Data sector", $d, $0 +>3863c1 6f 72 20 72 65 61 64 69 6e 67 20 44 61 74 61 20 +>3863d1 73 65 63 74 6f 72 0d 00 +>3863d9 49 6e 76 61 6c 69 64 20 INVALID_SIG_MSG .text 'Invalid MBR Signature',$D,0 +>3863e1 4d 42 52 20 53 69 67 6e 61 74 75 72 65 0d 00 +>3863f0 56 6f 6c 75 6d 65 20 4e sd_volume_name .text "Volume Name: ", $0 +>3863f8 61 6d 65 3a 20 00 +>3863fe 56 46 41 54 20 4e 61 6d sd_vfat_name .text "VFAT Name : ", $0 +>386406 65 20 20 3a 20 00 +>38640c 44 69 72 65 63 74 6f 72 sd_dir_name .text "Directory : ", $0 +>386414 79 20 20 3a 20 00 +>38641a 46 69 6c 65 6e 61 6d 65 sd_filename .text "Filename : ", $0 +>386422 20 20 20 3a 20 00 +>386428 2c 20 43 6c 75 73 74 65 sd_cluster_str .text ", Cluster:", $0 +>386430 72 3a 00 +>386433 2c 20 53 69 7a 65 3a 00 sd_filesize_str .text ", Size:", $0 ;****** Return to file: tracker.asm -.3863d3 TRACKER -.3863d3 a9 ff lda #$ff LDA #$FF -.3863d5 8f 48 01 00 sta $000148 STA @lINT_EDGE_REG0 -.3863d9 8f 49 01 00 sta $000149 STA @lINT_EDGE_REG1 -.3863dd 8f 4a 01 00 sta $00014a STA @lINT_EDGE_REG2 -.3863e1 a9 ff lda #$ff LDA #$FF -.3863e3 8f 4c 01 00 sta $00014c STA @lINT_MASK_REG0 -.3863e7 8f 4d 01 00 sta $00014d STA @lINT_MASK_REG1 -.3863eb 8f 4e 01 00 sta $00014e STA @lINT_MASK_REG2 -.3863ef 20 db 56 jsr $3856db JSR DRAW_DISPLAY -.3863f2 20 2c 67 jsr $38672c JSR INIT_KEYBOARD -.3863f5 20 c3 67 jsr $3867c3 JSR INIT_MOUSEPOINTER -.3863f8 20 37 64 jsr $386437 JSR INIT_CURSOR -.3863fb 20 79 64 jsr $386479 JSR RESET_STATE_MACHINE -.3863fe a9 38 lda #$38 LDA #`INSTRUMENT_ACCORDN -.386400 85 69 sta $69 STA INSTR_ADDR+2 -.386402 a9 42 lda #$42 LDA #$42 -.386404 8f 6a 00 00 sta $00006a STA @lINSTR_NUMBER -.386408 a2 00 00 ldx #$0000 LDX #0 ; setup channels -.38640b NEXT_INSTR -.38640b a9 00 lda #$00 LDA #0 -.38640d eb xba XBA -.38640e da phx PHX -.38640f bf 18 10 38 lda $381018,x LDA registerOffsets_operator0,X -.386413 aa tax TAX -.386414 20 4e 65 jsr $38654e JSR LOAD_INSTRUMENT -.386417 fa plx PLX -.386418 e8 inx INX -.386419 e0 09 00 cpx #$0009 CPX #9 -.38641c d0 ed bne $38640b BNE NEXT_INSTR -.38641e 22 79 30 38 jsl $383079 JSL IOPL2_TONE_TEST -.386422 20 58 64 jsr $386458 JSR ENABLE_IRQS -.386425 22 b1 30 38 jsl $3830b1 JSL OPL2_INIT -.386429 58 cli CLI -.38642a 20 ae 55 jsr $3855ae JSR INIT_MIDI -.38642d 20 2b 5b jsr $385b2b JSR DISPLAY_ORDERS -.386430 20 61 58 jsr $385861 JSR DISPLAY_PATTERN -.386433 ea nop ALWAYS NOP -.386434 ea nop NOP -.386435 80 fc bra $386433 BRA ALWAYS -.386437 48 pha INIT_CURSOR PHA -.386438 a9 e9 lda #$e9 LDA #$E9 ;The Cursor Character will be a Fully Filled Block -.38643a 8f 12 00 af sta $af0012 STA VKY_TXT_CURSOR_CHAR_REG -.38643e a9 00 lda #$00 LDA #$0 ;Set Cursor Disabled -.386440 8f 10 00 af sta $af0010 STA VKY_TXT_CURSOR_CTRL_REG ; -.386444 c2 30 rep #$30 REP #$30 ; set A&X long -.386446 a9 00 00 lda #$0000 LDA #$0000; -.386449 8f 14 00 af sta $af0014 STA VKY_TXT_CURSOR_X_REG_L; // Set the X to Position 1 -.38644d a9 00 00 lda #$0000 LDA #$0000; -.386450 8f 16 00 af sta $af0016 STA VKY_TXT_CURSOR_Y_REG_L; // Set the Y to Position 1 (Below) -.386454 e2 20 sep #$20 SEP #$20 ; set A short -.386456 68 pla PLA -.386457 60 rts RTS -.386458 ENABLE_IRQS -.386458 af 40 01 00 lda $000140 LDA @lINT_PENDING_REG0 -.38645c 29 84 and #$84 AND #FNX0_INT07_MOUSE | FNX0_INT02_TMR0 ;AND #FNX0_INT00_SOF -.38645e 8f 40 01 00 sta $000140 STA @lINT_PENDING_REG0 ; Writing it back will clear the Active Bit -.386462 af 41 01 00 lda $000141 LDA @lINT_PENDING_REG1 -.386466 29 a1 and #$a1 AND #FNX1_INT00_KBD | FNX1_INT05_MPU401 | FNX1_INT07_SDCARD -.386468 8f 41 01 00 sta $000141 STA @lINT_PENDING_REG1 ; Writing it back will clear the Active Bit -.38646c a9 7b lda #$7b LDA #~(FNX0_INT07_MOUSE | FNX0_INT02_TMR0) ;LDA #~(FNX0_INT00_SOF | FNX0_INT00_SOF ) -.38646e 8f 4c 01 00 sta $00014c STA @lINT_MASK_REG0 -.386472 a9 5e lda #$5e LDA #~(FNX1_INT00_KBD | FNX1_INT05_MPU401 | FNX1_INT07_SDCARD) -.386474 8f 4d 01 00 sta $00014d STA @lINT_MASK_REG1 -.386478 60 rts RTS -.386479 RESET_STATE_MACHINE -.386479 a9 00 lda #$00 LDA #0 -.38647b 8f 15 0f 38 sta $380f15 STA STATE_MACHINE -.38647f 85 48 sta $48 STA RAD_ORDER_NUM -.386481 64 6c stz $6c STZ LINE_NUM_HEX -.386483 64 49 stz $49 STZ RAD_ORDER_NUM + 1 -.386485 a9 01 lda #$01 LDA #1 -.386487 8f 19 0f 38 sta $380f19 STA LINE_NUM_DEC -.38648b a6 48 ldx $48 LDX RAD_ORDER_NUM -.38648d bf 24 fc 39 lda $39fc24,x LDA @lORDERS,X ; load the first pattern in the order list -.386491 1a inc a INC A -.386492 PATTN_OK -.386492 8f 18 0f 38 sta $380f18 STA PATTERN_NUM -.386496 20 af 5a jsr $385aaf JSR DISPLAY_SPEED -.386499 60 rts RTS -.38649a INCREMENT_ORDER -.38649a 48 pha PHA -.38649b a9 00 lda #$00 LDA #0 -.38649d eb xba XBA -.38649e af 48 00 00 lda $000048 LDA @lRAD_ORDER_NUM -.3864a2 1a inc a INC A -.3864a3 cf 68 6a 38 cmp $386a68 CMP @lTuneInfo.songLength -.3864a7 d0 02 bne $3864ab BNE LOAD_ORDER -.3864a9 a9 00 lda #$00 LDA #0 -.3864ab LOAD_ORDER -.3864ab 8f 48 00 00 sta $000048 STA @lRAD_ORDER_NUM -.3864af aa tax TAX -.3864b0 a0 90 01 ldy #$0190 LDY #SCREEN_WIDTH * 5 -.3864b3 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3864b6 bf 24 fc 39 lda $39fc24,x LDA @lORDERS,X ; load the pattern from the order list -.3864ba 1a inc a INC A -.3864bb 8f 18 0f 38 sta $380f18 STA PATTERN_NUM -.3864bf 68 pla PLA -.3864c0 60 rts RTS -.3864c1 INIT_TIMER0_BPM -.3864c1 8b phb PHB -.3864c2 a9 00 lda #$00 LDA #0 -.3864c4 48 pha PHA -.3864c5 ab plb PLB ; set databank to 0 -.3864c6 a9 03 lda #$03 LDA #3 ; each timer counter is 24 bits - 3 bytes -.3864c8 8d 00 01 sta $0100 STA UNSIGNED_MULT_A -.3864cb 9c 01 01 stz $0101 STZ UNSIGNED_MULT_A + 1 -.3864ce 9c 03 01 stz $0103 STZ UNSIGNED_MULT_B + 1 -.3864d1 38 sec SEC -.3864d2 af 17 0f 38 lda $380f17 LDA BPM ; multiply by the BPM, the 4 offset is the lowest BPM -.3864d6 e9 04 sbc #$04 SBC #4 -.3864d8 8d 02 01 sta $0102 STA UNSIGNED_MULT_B -.3864db c2 20 rep #$20 REP #$20 ; set A long -.3864dd ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT -.3864e0 aa tax TAX -.3864e1 e2 20 sep #$20 SEP #$20 ; set A short -.3864e3 a9 00 lda #$00 LDA #0 ; set timer0 charge to 0 -.3864e5 8d 61 01 sta $0161 STA TIMER0_CHARGE_L -.3864e8 8d 62 01 sta $0162 STA TIMER0_CHARGE_M -.3864eb 8d 63 01 sta $0163 STA TIMER0_CHARGE_H -.3864ee bf 00 00 3a lda $3a0000,x LDA @lSPM_004,X -.3864f2 8d 65 01 sta $0165 STA TIMER0_CMP_L -.3864f5 bf 01 00 3a lda $3a0001,x LDA @lSPM_004+1,X -.3864f9 8d 66 01 sta $0166 STA TIMER0_CMP_M -.3864fc bf 02 00 3a lda $3a0002,x LDA @lSPM_004+2,X -.386500 8d 67 01 sta $0167 STA TIMER0_CMP_H -.386503 a9 01 lda #$01 LDA #TMR0_CMP_RECLR ; count up from "CHARGE" value to TIMER_CMP -.386505 8d 64 01 sta $0164 STA TIMER0_CMP_REG -.386508 a9 0b lda #$0b LDA #(TMR0_EN | TMR0_UPDWN | TMR0_SCLR) -.38650a 8d 60 01 sta $0160 STA TIMER0_CTRL_REG -.38650d ab plb PLB -.38650e 60 rts RTS -.38650f INIT_TIMER0 -.38650f 8b phb PHB -.386510 a9 00 lda #$00 LDA #0 -.386512 48 pha PHA -.386513 ab plb PLB ; set databank to 0 -.386514 e2 20 sep #$20 SEP #$20 ; set A short -.386516 a9 00 lda #$00 LDA #0 ; set timer0 charge to 0 -.386518 8d 61 01 sta $0161 STA TIMER0_CHARGE_L -.38651b 8d 62 01 sta $0162 STA TIMER0_CHARGE_M -.38651e 8d 63 01 sta $0163 STA TIMER0_CHARGE_H -.386521 a9 01 lda #$01 LDA #TMR0_CMP_RECLR ; count up from "CHARGE" value to TIMER_CMP -.386523 8d 64 01 sta $0164 STA TIMER0_CMP_REG -.386526 a9 0b lda #$0b LDA #(TMR0_EN | TMR0_UPDWN | TMR0_SCLR) -.386528 8d 60 01 sta $0160 STA TIMER0_CTRL_REG -.38652b ab plb PLB -.38652c 60 rts RTS -.38652d INIT_OPL2_TMRS -.38652d a9 80 lda #$80 LDA #$80 ; Reset OPL2 Interrupts -.38652f 8f 04 e6 af sta $afe604 STA OPL3_L_IRQ ; byte 4 of OPL2 -.386533 20 47 65 jsr $386547 JSR WAIT_80 -.386536 a9 10 lda #$10 LDA #$10 -.386538 8f 02 e6 af sta $afe602 STA OPL3_L_TIMER1 ; byte 2 of OPL2 -.38653c 8f 03 e6 af sta $afe603 STA OPL3_L_TIMER2 ; byte 2 of OPL2 -.386540 a9 03 lda #$03 LDA #$3 ; enable timers 1 and 2 -.386542 8f 04 e6 af sta $afe604 STA OPL3_L_IRQ ; byte 4 of OPL2 -.386546 60 rts RTS -.386547 WAIT_80 -.386547 a2 30 02 ldx #$0230 LDX #560 -.38654a WAIT_LP -.38654a ca dex DEX -.38654b d0 fd bne $38654a BNE WAIT_LP -.38654d 60 rts RTS -.38654e LOAD_INSTRUMENT -.38654e af 6a 00 00 lda $00006a LDA @lINSTR_NUMBER -.386552 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.386556 a9 00 lda #$00 LDA #0 -.386558 8f 01 01 00 sta $000101 STA @lUNSIGNED_MULT_A + 1 -.38655c 8f 03 01 00 sta $000103 STA @lUNSIGNED_MULT_B + 1 -.386560 a9 16 lda #$16 LDA #INSTR_REC_LEN -.386562 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.386566 c2 20 rep #$20 REP #$20 ; set A long -.386568 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.38656c 18 clc CLC -.38656d 69 3b 10 adc #$103b ADC #<>INSTRUMENT_ACCORDN -.386570 85 67 sta $67 STA INSTR_ADDR -.386572 e2 20 sep #$20 SEP #$20 ; set A short -.386574 af 6a 00 00 lda $00006a LDA @lINSTR_NUMBER -.386578 a0 a3 01 ldy #$01a3 LDY #5 * SCREEN_WIDTH + 19 -.38657b 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38657e a7 67 lda [$67] LDA [INSTR_ADDR] -.386580 d0 4b bne $3865cd BNE DRUM_SET -.386582 e6 67 inc $67 INC INSTR_ADDR -.386584 d0 02 bne $386588 BNE LD_INST_1 -.386586 e6 68 inc $68 INC INSTR_ADDR+1 -.386588 LD_INST_1 -.386588 20 ce 65 jsr $3865ce JSR LOAD_AM_VIB_MULT -.38658b e6 67 inc $67 INC INSTR_ADDR -.38658d d0 02 bne $386591 BNE LD_INST_2 -.38658f e6 68 inc $68 INC INSTR_ADDR+1 -.386591 LD_INST_2 -.386591 20 3e 66 jsr $38663e JSR LOAD_KEY_OP_LVL -.386594 e6 67 inc $67 INC INSTR_ADDR -.386596 d0 02 bne $38659a BNE LD_INST_3 -.386598 e6 68 inc $68 INC INSTR_ADDR+1 -.38659a LD_INST_3 -.38659a 20 78 66 jsr $386678 JSR LOAD_ATT_DEC_RATE -.38659d e6 67 inc $67 INC INSTR_ADDR -.38659f d0 02 bne $3865a3 BNE LD_INST_4 -.3865a1 e6 68 inc $68 INC INSTR_ADDR+1 -.3865a3 LD_INST_4 -.3865a3 20 b4 66 jsr $3866b4 JSR LOAD_SUSTAIN_RELEASE_RATE -.3865a6 e6 67 inc $67 INC INSTR_ADDR -.3865a8 d0 02 bne $3865ac BNE LD_INST_5 -.3865aa e6 68 inc $68 INC INSTR_ADDR+1 -.3865ac LD_INST_5 -.3865ac da phx PHX -.3865ad a6 27 ldx $27 LDX OPL2_CHANNEL -.3865af 20 f0 66 jsr $3866f0 JSR LOAD_FEEDBACK_ALGO -.3865b2 fa plx PLX -.3865b3 e6 67 inc $67 INC INSTR_ADDR -.3865b5 d0 02 bne $3865b9 BNE LD_INST_6 -.3865b7 e6 68 inc $68 INC INSTR_ADDR+1 -.3865b9 LD_INST_6 -.3865b9 20 0c 67 jsr $38670c JSR LOAD_WAVE -.3865bc c2 20 rep #$20 REP #$20 ; set A long -.3865be a5 67 lda $67 LDA INSTR_ADDR -.3865c0 69 06 00 adc #$0006 ADC #6 -.3865c3 85 67 sta $67 STA INSTR_ADDR -.3865c5 e2 20 sep #$20 SEP #$20 ; set A short -.3865c7 a0 a8 01 ldy #$01a8 LDY #5 * SCREEN_WIDTH + 24 -.3865ca 20 3d 58 jsr $38583d JSR WRITE_INSTRUMENT_NAME -.3865cd DRUM_SET -.3865cd 60 rts RTS -.3865ce LOAD_AM_VIB_MULT -.3865ce a7 67 lda [$67] LDA [INSTR_ADDR] -.3865d0 48 pha PHA -.3865d1 48 pha PHA -.3865d2 48 pha PHA -.3865d3 48 pha PHA -.3865d4 9f 20 e7 af sta $afe720,x STA @lOPL3_R_AM_VID_EG_KSR_MULT,X -.3865d8 29 80 and #$80 AND #TREMOLO -.3865da a0 3d 02 ldy #$023d LDY #7 * SCREEN_WIDTH + 13 -.3865dd 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.3865e0 68 pla PLA -.3865e1 29 40 and #$40 AND #VIBRATO -.3865e3 a0 8d 02 ldy #$028d LDY #8 * SCREEN_WIDTH + 13 -.3865e6 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.3865e9 68 pla PLA -.3865ea 29 20 and #$20 AND #SUSTAINING -.3865ec a0 dd 02 ldy #$02dd LDY #9 * SCREEN_WIDTH + 13 -.3865ef 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.3865f2 68 pla PLA -.3865f3 29 10 and #$10 AND #KSR -.3865f5 a0 2d 03 ldy #$032d LDY #10 * SCREEN_WIDTH + 13 -.3865f8 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.3865fb 68 pla PLA -.3865fc 29 0f and #$0f AND #MULTIPLIER -.3865fe a0 7e 03 ldy #$037e LDY #11 * SCREEN_WIDTH + 14 -.386601 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386604 a0 06 00 ldy #$0006 LDY #6 -.386607 b7 67 lda [$67],y LDA [INSTR_ADDR], Y -.386609 48 pha PHA -.38660a 48 pha PHA -.38660b 48 pha PHA -.38660c 48 pha PHA -.38660d 9f 23 e7 af sta $afe723,x STA @lOPL3_R_AM_VID_EG_KSR_MULT + 3,X -.386611 29 80 and #$80 AND #TREMOLO -.386613 a0 57 02 ldy #$0257 LDY #7 * SCREEN_WIDTH + 39 -.386616 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.386619 68 pla PLA -.38661a 29 40 and #$40 AND #VIBRATO -.38661c a0 a7 02 ldy #$02a7 LDY #8 * SCREEN_WIDTH + 39 -.38661f 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.386622 68 pla PLA -.386623 29 20 and #$20 AND #SUSTAINING -.386625 a0 f7 02 ldy #$02f7 LDY #9 * SCREEN_WIDTH + 39 -.386628 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.38662b 68 pla PLA -.38662c 29 10 and #$10 AND #KSR -.38662e a0 47 03 ldy #$0347 LDY #10 * SCREEN_WIDTH + 39 -.386631 20 ee 57 jsr $3857ee JSR WRITE_OFF_ON -.386634 68 pla PLA -.386635 29 0f and #$0f AND #MULTIPLIER -.386637 a0 98 03 ldy #$0398 LDY #11 * SCREEN_WIDTH + 40 -.38663a 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38663d 60 rts RTS -.38663e LOAD_KEY_OP_LVL -.38663e a7 67 lda [$67] LDA [INSTR_ADDR] -.386640 48 pha PHA -.386641 9f 40 e7 af sta $afe740,x STA @lOPL3_R_KSL_TL,X -.386645 29 c0 and #$c0 AND #KEY_SCALE -.386647 2a rol a ROL A -.386648 2a rol a ROL A -.386649 2a rol a ROL A -.38664a a0 ce 03 ldy #$03ce LDY #12 * SCREEN_WIDTH + 14 -.38664d 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386650 68 pla PLA -.386651 29 3f and #$3f AND #OP_LEVEL -.386653 a0 1e 04 ldy #$041e LDY #13 * SCREEN_WIDTH + 14 -.386656 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386659 a0 06 00 ldy #$0006 LDY #6 -.38665c b7 67 lda [$67],y LDA [INSTR_ADDR],Y -.38665e 48 pha PHA -.38665f 9f 43 e7 af sta $afe743,x STA @lOPL3_R_KSL_TL + 3,X -.386663 29 c0 and #$c0 AND #KEY_SCALE -.386665 2a rol a ROL A -.386666 2a rol a ROL A -.386667 2a rol a ROL A -.386668 a0 e8 03 ldy #$03e8 LDY #12 * SCREEN_WIDTH + 40 -.38666b 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38666e 68 pla PLA -.38666f 29 3f and #$3f AND #OP_LEVEL -.386671 a0 38 04 ldy #$0438 LDY #13 * SCREEN_WIDTH + 40 -.386674 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386677 60 rts RTS -.386678 LOAD_ATT_DEC_RATE -.386678 a7 67 lda [$67] LDA [INSTR_ADDR] -.38667a 48 pha PHA -.38667b 9f 60 e7 af sta $afe760,x STA @lOPL3_R_AR_DR,X -.38667f 29 f0 and #$f0 AND #ATTACK_RT -.386681 4a lsr a LSR A -.386682 4a lsr a LSR A -.386683 4a lsr a LSR A -.386684 4a lsr a LSR A -.386685 a0 6e 04 ldy #$046e LDY #14 * SCREEN_WIDTH + 14 -.386688 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38668b 68 pla PLA -.38668c 29 0f and #$0f AND #DECAY_RT -.38668e a0 be 04 ldy #$04be LDY #15 * SCREEN_WIDTH + 14 -.386691 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386694 a0 06 00 ldy #$0006 LDY #6 -.386697 b7 67 lda [$67],y LDA [INSTR_ADDR],Y -.386699 48 pha PHA -.38669a 9f 63 e7 af sta $afe763,x STA @lOPL3_R_AR_DR + 3,X -.38669e 29 f0 and #$f0 AND #ATTACK_RT -.3866a0 4a lsr a LSR A -.3866a1 4a lsr a LSR A -.3866a2 4a lsr a LSR A -.3866a3 4a lsr a LSR A -.3866a4 a0 88 04 ldy #$0488 LDY #14 * SCREEN_WIDTH + 40 -.3866a7 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3866aa 68 pla PLA -.3866ab 29 0f and #$0f AND #DECAY_RT -.3866ad a0 d8 04 ldy #$04d8 LDY #15 * SCREEN_WIDTH + 40 -.3866b0 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3866b3 60 rts RTS -.3866b4 LOAD_SUSTAIN_RELEASE_RATE -.3866b4 a7 67 lda [$67] LDA [INSTR_ADDR] -.3866b6 48 pha PHA -.3866b7 9f 80 e7 af sta $afe780,x STA @lOPL3_R_SL_RR,X -.3866bb 29 f0 and #$f0 AND #ATTACK_RT -.3866bd 4a lsr a LSR A -.3866be 4a lsr a LSR A -.3866bf 4a lsr a LSR A -.3866c0 4a lsr a LSR A -.3866c1 a0 0e 05 ldy #$050e LDY #16 * SCREEN_WIDTH + 14 -.3866c4 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3866c7 68 pla PLA -.3866c8 29 0f and #$0f AND #DECAY_RT -.3866ca a0 5e 05 ldy #$055e LDY #17 * SCREEN_WIDTH + 14 -.3866cd 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3866d0 a0 06 00 ldy #$0006 LDY #6 -.3866d3 b7 67 lda [$67],y LDA [INSTR_ADDR],Y -.3866d5 48 pha PHA -.3866d6 9f 83 e7 af sta $afe783,x STA @lOPL3_R_SL_RR + 3,X -.3866da 29 f0 and #$f0 AND #ATTACK_RT -.3866dc 4a lsr a LSR A -.3866dd 4a lsr a LSR A -.3866de 4a lsr a LSR A -.3866df 4a lsr a LSR A -.3866e0 a0 28 05 ldy #$0528 LDY #16 * SCREEN_WIDTH + 40 -.3866e3 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3866e6 68 pla PLA -.3866e7 29 0f and #$0f AND #DECAY_RT -.3866e9 a0 78 05 ldy #$0578 LDY #17 * SCREEN_WIDTH + 40 -.3866ec 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.3866ef 60 rts RTS -.3866f0 LOAD_FEEDBACK_ALGO -.3866f0 a7 67 lda [$67] LDA [INSTR_ADDR] -.3866f2 48 pha PHA -.3866f3 09 f0 ora #$f0 ORA #$F0 ; Channel B -.3866f5 9f c0 e7 af sta $afe7c0,x STA @lOPL3_R_FEEDBACK,X -.3866f9 29 0e and #$0e AND #FEEDBACK -.3866fb 4a lsr a LSR A -.3866fc a0 68 06 ldy #$0668 LDY #20 * SCREEN_WIDTH + 40 -.3866ff 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386702 68 pla PLA -.386703 29 01 and #$01 AND #ALGORITHM -.386705 a0 b8 06 ldy #$06b8 LDY #21 * SCREEN_WIDTH + 40 -.386708 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38670b 60 rts RTS -.38670c LOAD_WAVE -.38670c a7 67 lda [$67] LDA [INSTR_ADDR] -.38670e 9f e0 e7 af sta $afe7e0,x STA @lOPL3_R_WAVE_SELECT,X -.386712 29 07 and #$07 AND #$7 -.386714 a0 ae 05 ldy #$05ae LDY #18 * SCREEN_WIDTH + 14 -.386717 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38671a a0 05 00 ldy #$0005 LDY #5 -.38671d b7 67 lda [$67],y LDA [INSTR_ADDR],Y -.38671f 9f e3 e7 af sta $afe7e3,x STA @lOPL3_R_WAVE_SELECT+3,X -.386723 29 07 and #$07 AND #$7 -.386725 a0 c8 05 ldy #$05c8 LDY #18 * SCREEN_WIDTH + 40 -.386728 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.38672b 60 rts RTS -.38672c INIT_KEYBOARD -.38672c 0b phd PHD -.38672d 48 pha PHA -.38672e da phx PHX -.38672f 08 php PHP -.386730 18 clc CLC -.386731 e2 20 sep #$20 SEP #$20 ; set A short -.386733 a9 00 lda #$00 LDA #$00 -.386735 8d 87 0f sta $0f87 STA KEYBOARD_SC_FLG ; Clear the Keyboard Flag -.386738 20 da 67 jsr $3867da JSR Poll_Inbuf -.38673b a9 aa lda #$aa LDA #$AA ;Send self test command -.38673d 8f 64 10 af sta $af1064 STA KBD_CMD_BUF -.386741 20 e5 67 jsr $3867e5 JSR Poll_Outbuf ; -.386744 af 60 10 af lda $af1060 LDA KBD_OUT_BUF ;Check self test result -.386748 c9 55 cmp #$55 CMP #$55 -.38674a f0 03 beq $38674f BEQ passAAtest -.38674c 82 6f 00 brl $3867be BRL initkb_loop_out -.38674f passAAtest -.38674f a9 ab lda #$ab LDA #$AB ;Send test Interface command -.386751 8f 64 10 af sta $af1064 STA KBD_CMD_BUF -.386755 20 e5 67 jsr $3867e5 JSR Poll_Outbuf ; -.386758 af 60 10 af lda $af1060 LDA KBD_OUT_BUF ;Display Interface test results -.38675c c9 00 cmp #$00 CMP #$00 ;Should be 00 -.38675e f0 03 beq $386763 BEQ passABtest -.386760 82 5b 00 brl $3867be BRL initkb_loop_out -.386763 passABtest -.386763 a9 60 lda #$60 LDA #$60 ; Send Command 0x60 so to Enable Interrupt -.386765 8f 64 10 af sta $af1064 STA KBD_CMD_BUF -.386769 20 da 67 jsr $3867da JSR Poll_Inbuf ; -.38676c a9 69 lda #$69 LDA #%01101001 ; Enable Interrupt -.38676e 8f 60 10 af sta $af1060 STA KBD_DATA_BUF -.386772 20 da 67 jsr $3867da JSR Poll_Inbuf ; -.386775 a9 ff lda #$ff LDA #$FF ; Send Keyboard Reset command -.386777 8f 60 10 af sta $af1060 STA KBD_DATA_BUF -.38677b a2 ff ff ldx #$ffff LDX #$FFFF -.38677e ca dex DLY_LOOP1 DEX -.38677f ea nop NOP -.386780 ea nop NOP -.386781 ea nop NOP -.386782 ea nop NOP -.386783 ea nop NOP -.386784 ea nop NOP -.386785 ea nop NOP -.386786 ea nop NOP -.386787 e0 00 00 cpx #$0000 CPX #$0000 -.38678a d0 f2 bne $38677e BNE DLY_LOOP1 -.38678c 20 e5 67 jsr $3867e5 JSR Poll_Outbuf ; -.38678f af 60 10 af lda $af1060 LDA KBD_OUT_BUF ; Read Output Buffer -.386793 DO_CMD_F4_AGAIN -.386793 20 da 67 jsr $3867da JSR Poll_Inbuf ; -.386796 a9 f4 lda #$f4 LDA #$F4 ; Enable the Keyboard -.386798 8f 60 10 af sta $af1060 STA KBD_DATA_BUF -.38679c 20 e5 67 jsr $3867e5 JSR Poll_Outbuf ; -.38679f af 60 10 af lda $af1060 LDA KBD_OUT_BUF ; Clear the Output buffer -.3867a3 c9 fa cmp #$fa CMP #$FA -.3867a5 d0 ec bne $386793 BNE DO_CMD_F4_AGAIN -.3867a7 20 f0 67 jsr $3867f0 JSR INIT_MOUSE -.3867aa af 40 01 00 lda $000140 LDA @lINT_PENDING_REG0 ; Read the Pending Register & -.3867ae 29 80 and #$80 AND #FNX0_INT07_MOUSE -.3867b0 8f 40 01 00 sta $000140 STA @lINT_PENDING_REG0 ; Writing it back will clear the Active Bit -.3867b4 af 41 01 00 lda $000141 LDA @lINT_PENDING_REG1 ; Read the Pending Register & -.3867b8 29 01 and #$01 AND #FNX1_INT00_KBD -.3867ba 8f 41 01 00 sta $000141 STA @lINT_PENDING_REG1 ; Writing it back will clear the Active Bit -.3867be initkb_loop_out -.3867be InitSuccess -.3867be 28 plp PLP -.3867bf fa plx PLX -.3867c0 68 pla PLA -.3867c1 2b pld PLD -.3867c2 60 rts RTS -.3867c3 INIT_MOUSEPOINTER -.3867c3 c2 30 rep #$30 REP #$30 ; set A&X long -.3867c5 a2 80 4d ldx #$4d80 LDX #<>MOUSE_POINTER_PTR -.3867c8 a9 00 01 lda #$0100 LDA #$100 -.3867cb a0 00 05 ldy #$0500 LDY #$0500 -.3867ce 54 af 38 mvn $38,$af MVN #`MOUSE_POINTER_PTR,#$AF -.3867d1 e2 20 sep #$20 SEP #$20 ; set A short -.3867d3 a9 01 lda #$01 LDA #$01 -.3867d5 8f 00 07 af sta $af0700 STA @lMOUSE_PTR_CTRL_REG_L ; Enable Mouse, Mouse Pointer Graphic Bank 0 -.3867d9 60 rts RTS -.3867da Poll_Inbuf -.3867da af 64 10 af lda $af1064 LDA STATUS_PORT ; Load Status Byte -.3867de 29 02 and #$02 AND #3868b2 01 01 01 01 01 01 01 01 CHANNELS .byte 1,1,1,1,1,1,1,1,1 ->3868ba 01 -.3868bb TOGGLE_CHANNEL -.3868bb aa tax TAX -.3868bc ca dex DEX -.3868bd bf b2 68 38 lda $3868b2,x LDA CHANNELS,X -.3868c1 49 01 eor #$01 EOR #1 -.3868c3 9f b2 68 38 sta $3868b2,x STA CHANNELS,X -.3868c7 60 rts RTS ->3868c8 80 80 80 31 33 80 36 38 SCAN_TO_NOTE .text $80, $80, $80, $31, $33, $80, $36, $38, $3A, $80, $41, $80, $80, $80, $80, $80 ->3868d0 3a 80 41 80 80 80 80 80 ->3868d8 2c 32 34 35 37 39 3b 3c .text $2C, $32, $34, $35, $37, $39, $3B, $3C, $42, $80, $80, $80, $80, $80, $80, $21 ->3868e0 42 80 80 80 80 80 80 21 ->3868e8 23 80 26 28 2a 80 80 80 .text $23, $80, $26, $28, $2A, $80, $80, $80, $80, $80, $80, $80, $1C, $22, $24, $25 ->3868f0 80 80 80 80 1c 22 24 25 ->3868f8 27 29 2b 80 80 80 80 80 .text $27, $29, $2B, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80 ->386900 80 80 80 80 80 80 80 80 ->386908 80 80 80 80 80 80 80 80 .text $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80 ->386910 80 80 80 80 80 80 80 80 ->386918 80 80 80 80 80 80 80 80 .text $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80 ->386920 80 80 80 80 80 80 80 80 -.386928 MIDI_COMMAND_TABLE ->386928 02 56 02 56 .word <>NOTE_OFF, <>NOTE_ON ->38692c 82 56 82 56 .word <>POLY_PRESSURE, <>CONTROL_CHANGE ->386930 ab 56 ab 56 .word <>PROGRAM_CHANGE, <>CHANNEL_PRESSURE ; these two command expect 1 datat byte only - no running status ->386934 82 56 c2 56 .word <>PITCH_BEND, <>SYSTEM_COMMAND ->386938 da 56 .word <>INVALID_COMMAND +.38643b TRACKER +.38643b a9 ff lda #$ff LDA #$FF +.38643d 8f 48 01 00 sta $000148 STA @lINT_EDGE_REG0 +.386441 8f 49 01 00 sta $000149 STA @lINT_EDGE_REG1 +.386445 8f 4a 01 00 sta $00014a STA @lINT_EDGE_REG2 +.386449 a9 ff lda #$ff LDA #$FF +.38644b 8f 4c 01 00 sta $00014c STA @lINT_MASK_REG0 +.38644f 8f 4d 01 00 sta $00014d STA @lINT_MASK_REG1 +.386453 8f 4e 01 00 sta $00014e STA @lINT_MASK_REG2 +.386457 20 db 56 jsr $3856db JSR DRAW_DISPLAY +.38645a 20 97 67 jsr $386797 JSR INIT_KEYBOARD +.38645d 20 2e 68 jsr $38682e JSR INIT_MOUSEPOINTER +.386460 20 a2 64 jsr $3864a2 JSR INIT_CURSOR +.386463 20 e4 64 jsr $3864e4 JSR RESET_STATE_MACHINE +.386466 a9 38 lda #$38 LDA #`INSTRUMENT_ACCORDN +.386468 85 69 sta $69 STA INSTR_ADDR+2 +.38646a a9 42 lda #$42 LDA #$42 +.38646c 8f 6a 00 00 sta $00006a STA @lINSTR_NUMBER +.386470 a2 00 00 ldx #$0000 LDX #0 ; setup channels +.386473 NEXT_INSTR +.386473 a9 00 lda #$00 LDA #0 +.386475 eb xba XBA +.386476 da phx PHX +.386477 bf 18 10 38 lda $381018,x LDA registerOffsets_operator0,X +.38647b aa tax TAX +.38647c 20 b9 65 jsr $3865b9 JSR LOAD_INSTRUMENT +.38647f fa plx PLX +.386480 e8 inx INX +.386481 e0 09 00 cpx #$0009 CPX #9 +.386484 d0 ed bne $386473 BNE NEXT_INSTR +.386486 22 79 30 38 jsl $383079 JSL IOPL2_TONE_TEST +.38648a 20 c3 64 jsr $3864c3 JSR ENABLE_IRQS +.38648d 22 b1 30 38 jsl $3830b1 JSL OPL3_INIT +.386491 20 7a 65 jsr $38657a JSR INIT_TIMER0 ; TIMER0 is setup for 50hz +.386494 20 ae 55 jsr $3855ae JSR INIT_MIDI +.386497 20 1d 5b jsr $385b1d JSR DISPLAY_ORDERS +.38649a 20 53 58 jsr $385853 JSR DISPLAY_PATTERN +.38649d 58 cli CLI +.38649e ea nop ALWAYS NOP +.38649f ea nop NOP +.3864a0 80 fc bra $38649e BRA ALWAYS +.3864a2 48 pha INIT_CURSOR PHA +.3864a3 a9 e9 lda #$e9 LDA #$E9 ;The Cursor Character will be a Fully Filled Block +.3864a5 8f 12 00 af sta $af0012 STA VKY_TXT_CURSOR_CHAR_REG +.3864a9 a9 00 lda #$00 LDA #$0 ;Set Cursor Disabled +.3864ab 8f 10 00 af sta $af0010 STA VKY_TXT_CURSOR_CTRL_REG ; +.3864af c2 30 rep #$30 REP #$30 ; set A&X long +.3864b1 a9 00 00 lda #$0000 LDA #$0000; +.3864b4 8f 14 00 af sta $af0014 STA VKY_TXT_CURSOR_X_REG_L; // Set the X to Position 1 +.3864b8 a9 00 00 lda #$0000 LDA #$0000; +.3864bb 8f 16 00 af sta $af0016 STA VKY_TXT_CURSOR_Y_REG_L; // Set the Y to Position 1 (Below) +.3864bf e2 20 sep #$20 SEP #$20 ; set A short +.3864c1 68 pla PLA +.3864c2 60 rts RTS +.3864c3 ENABLE_IRQS +.3864c3 af 40 01 00 lda $000140 LDA @lINT_PENDING_REG0 +.3864c7 29 84 and #$84 AND #FNX0_INT07_MOUSE | FNX0_INT02_TMR0 ;AND #FNX0_INT00_SOF +.3864c9 8f 40 01 00 sta $000140 STA @lINT_PENDING_REG0 ; Writing it back will clear the Active Bit +.3864cd af 41 01 00 lda $000141 LDA @lINT_PENDING_REG1 +.3864d1 29 a1 and #$a1 AND #FNX1_INT00_KBD | FNX1_INT05_MPU401 | FNX1_INT07_SDCARD +.3864d3 8f 41 01 00 sta $000141 STA @lINT_PENDING_REG1 ; Writing it back will clear the Active Bit +.3864d7 a9 7b lda #$7b LDA #~(FNX0_INT07_MOUSE | FNX0_INT02_TMR0) ;LDA #~(FNX0_INT00_SOF | FNX0_INT00_SOF ) +.3864d9 8f 4c 01 00 sta $00014c STA @lINT_MASK_REG0 +.3864dd a9 5e lda #$5e LDA #~(FNX1_INT00_KBD | FNX1_INT05_MPU401 | FNX1_INT07_SDCARD) +.3864df 8f 4d 01 00 sta $00014d STA @lINT_MASK_REG1 +.3864e3 60 rts RTS +.3864e4 RESET_STATE_MACHINE +.3864e4 a9 00 lda #$00 LDA #0 +.3864e6 8f 15 0f 38 sta $380f15 STA STATE_MACHINE +.3864ea 85 48 sta $48 STA RAD_ORDER_NUM +.3864ec 64 6c stz $6c STZ LINE_NUM_HEX +.3864ee 64 49 stz $49 STZ RAD_ORDER_NUM + 1 +.3864f0 a9 01 lda #$01 LDA #1 +.3864f2 8f 19 0f 38 sta $380f19 STA LINE_NUM_DEC +.3864f6 a6 48 ldx $48 LDX RAD_ORDER_NUM +.3864f8 bf 24 fc 39 lda $39fc24,x LDA @lORDERS,X ; load the first pattern in the order list +.3864fc 1a inc a INC A +.3864fd PATTN_OK +.3864fd 8f 18 0f 38 sta $380f18 STA PATTERN_NUM +.386501 20 a1 5a jsr $385aa1 JSR DISPLAY_SPEED +.386504 60 rts RTS +.386505 INCREMENT_ORDER +.386505 48 pha PHA +.386506 a9 00 lda #$00 LDA #0 +.386508 eb xba XBA +.386509 af 48 00 00 lda $000048 LDA @lRAD_ORDER_NUM +.38650d 1a inc a INC A +.38650e cf d3 6a 38 cmp $386ad3 CMP @lTuneInfo.songLength +.386512 d0 02 bne $386516 BNE LOAD_ORDER +.386514 a9 00 lda #$00 LDA #0 +.386516 LOAD_ORDER +.386516 8f 48 00 00 sta $000048 STA @lRAD_ORDER_NUM +.38651a aa tax TAX +.38651b a0 90 01 ldy #$0190 LDY #SCREEN_WIDTH * 5 +.38651e 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386521 bf 24 fc 39 lda $39fc24,x LDA @lORDERS,X ; load the pattern from the order list +.386525 1a inc a INC A +.386526 8f 18 0f 38 sta $380f18 STA PATTERN_NUM +.38652a 68 pla PLA +.38652b 60 rts RTS +.38652c INIT_TIMER0_BPM +.38652c 8b phb PHB +.38652d a9 00 lda #$00 LDA #0 +.38652f 48 pha PHA +.386530 ab plb PLB ; set databank to 0 +.386531 a9 03 lda #$03 LDA #3 ; each timer counter is 24 bits - 3 bytes +.386533 8d 00 01 sta $0100 STA UNSIGNED_MULT_A +.386536 9c 01 01 stz $0101 STZ UNSIGNED_MULT_A + 1 +.386539 9c 03 01 stz $0103 STZ UNSIGNED_MULT_B + 1 +.38653c 38 sec SEC +.38653d af 17 0f 38 lda $380f17 LDA BPM ; multiply by the BPM, the 4 offset is the lowest BPM +.386541 e9 04 sbc #$04 SBC #4 +.386543 8d 02 01 sta $0102 STA UNSIGNED_MULT_B +.386546 c2 20 rep #$20 REP #$20 ; set A long +.386548 ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT +.38654b aa tax TAX +.38654c e2 20 sep #$20 SEP #$20 ; set A short +.38654e a9 00 lda #$00 LDA #0 ; set timer0 charge to 0 +.386550 8d 61 01 sta $0161 STA TIMER0_CHARGE_L +.386553 8d 62 01 sta $0162 STA TIMER0_CHARGE_M +.386556 8d 63 01 sta $0163 STA TIMER0_CHARGE_H +.386559 bf 00 00 3a lda $3a0000,x LDA @lSPM_004,X +.38655d 8d 65 01 sta $0165 STA TIMER0_CMP_L +.386560 bf 01 00 3a lda $3a0001,x LDA @lSPM_004+1,X +.386564 8d 66 01 sta $0166 STA TIMER0_CMP_M +.386567 bf 02 00 3a lda $3a0002,x LDA @lSPM_004+2,X +.38656b 8d 67 01 sta $0167 STA TIMER0_CMP_H +.38656e a9 01 lda #$01 LDA #TMR0_CMP_RECLR ; count up from "CHARGE" value to TIMER_CMP +.386570 8d 64 01 sta $0164 STA TIMER0_CMP_REG +.386573 a9 0b lda #$0b LDA #(TMR0_EN | TMR0_UPDWN | TMR0_SCLR) +.386575 8d 60 01 sta $0160 STA TIMER0_CTRL_REG +.386578 ab plb PLB +.386579 60 rts RTS +.38657a INIT_TIMER0 +.38657a 8b phb PHB +.38657b a9 00 lda #$00 LDA #0 +.38657d 48 pha PHA +.38657e ab plb PLB ; set databank to 0 +.38657f e2 20 sep #$20 SEP #$20 ; set A short +.386581 a9 00 lda #$00 LDA #0 ; set timer0 charge to 0 +.386583 8d 61 01 sta $0161 STA TIMER0_CHARGE_L +.386586 8d 62 01 sta $0162 STA TIMER0_CHARGE_M +.386589 8d 63 01 sta $0163 STA TIMER0_CHARGE_H +.38658c a9 01 lda #$01 LDA #TMR0_CMP_RECLR ; count up from "CHARGE" value to TIMER_CMP +.38658e 8d 64 01 sta $0164 STA TIMER0_CMP_REG +.386591 a9 0b lda #$0b LDA #(TMR0_EN | TMR0_UPDWN | TMR0_SCLR) +.386593 8d 60 01 sta $0160 STA TIMER0_CTRL_REG +.386596 ab plb PLB +.386597 60 rts RTS +.386598 INIT_OPL2_TMRS +.386598 a9 80 lda #$80 LDA #$80 ; Reset OPL2 Interrupts +.38659a 8f 04 e6 af sta $afe604 STA OPL3_L_IRQ ; byte 4 of OPL2 +.38659e 20 b2 65 jsr $3865b2 JSR WAIT_80 +.3865a1 a9 10 lda #$10 LDA #$10 +.3865a3 8f 02 e6 af sta $afe602 STA OPL3_L_TIMER1 ; byte 2 of OPL2 +.3865a7 8f 03 e6 af sta $afe603 STA OPL3_L_TIMER2 ; byte 2 of OPL2 +.3865ab a9 03 lda #$03 LDA #$3 ; enable timers 1 and 2 +.3865ad 8f 04 e6 af sta $afe604 STA OPL3_L_IRQ ; byte 4 of OPL2 +.3865b1 60 rts RTS +.3865b2 WAIT_80 +.3865b2 a2 30 02 ldx #$0230 LDX #560 +.3865b5 WAIT_LP +.3865b5 ca dex DEX +.3865b6 d0 fd bne $3865b5 BNE WAIT_LP +.3865b8 60 rts RTS +.3865b9 LOAD_INSTRUMENT +.3865b9 af 6a 00 00 lda $00006a LDA @lINSTR_NUMBER +.3865bd 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.3865c1 a9 00 lda #$00 LDA #0 +.3865c3 8f 01 01 00 sta $000101 STA @lUNSIGNED_MULT_A + 1 +.3865c7 8f 03 01 00 sta $000103 STA @lUNSIGNED_MULT_B + 1 +.3865cb a9 16 lda #$16 LDA #INSTR_REC_LEN +.3865cd 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.3865d1 c2 20 rep #$20 REP #$20 ; set A long +.3865d3 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.3865d7 18 clc CLC +.3865d8 69 3b 10 adc #$103b ADC #<>INSTRUMENT_ACCORDN +.3865db 85 67 sta $67 STA INSTR_ADDR +.3865dd e2 20 sep #$20 SEP #$20 ; set A short +.3865df af 6a 00 00 lda $00006a LDA @lINSTR_NUMBER +.3865e3 a0 a3 01 ldy #$01a3 LDY #5 * SCREEN_WIDTH + 19 +.3865e6 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3865e9 a7 67 lda [$67] LDA [INSTR_ADDR] +.3865eb d0 4b bne $386638 BNE DRUM_SET +.3865ed e6 67 inc $67 INC INSTR_ADDR +.3865ef d0 02 bne $3865f3 BNE LD_INST_1 +.3865f1 e6 68 inc $68 INC INSTR_ADDR+1 +.3865f3 LD_INST_1 +.3865f3 20 39 66 jsr $386639 JSR LOAD_AM_VIB_MULT +.3865f6 e6 67 inc $67 INC INSTR_ADDR +.3865f8 d0 02 bne $3865fc BNE LD_INST_2 +.3865fa e6 68 inc $68 INC INSTR_ADDR+1 +.3865fc LD_INST_2 +.3865fc 20 a9 66 jsr $3866a9 JSR LOAD_KEY_OP_LVL +.3865ff e6 67 inc $67 INC INSTR_ADDR +.386601 d0 02 bne $386605 BNE LD_INST_3 +.386603 e6 68 inc $68 INC INSTR_ADDR+1 +.386605 LD_INST_3 +.386605 20 e3 66 jsr $3866e3 JSR LOAD_ATT_DEC_RATE +.386608 e6 67 inc $67 INC INSTR_ADDR +.38660a d0 02 bne $38660e BNE LD_INST_4 +.38660c e6 68 inc $68 INC INSTR_ADDR+1 +.38660e LD_INST_4 +.38660e 20 1f 67 jsr $38671f JSR LOAD_SUSTAIN_RELEASE_RATE +.386611 e6 67 inc $67 INC INSTR_ADDR +.386613 d0 02 bne $386617 BNE LD_INST_5 +.386615 e6 68 inc $68 INC INSTR_ADDR+1 +.386617 LD_INST_5 +.386617 da phx PHX +.386618 a6 27 ldx $27 LDX OPL2_CHANNEL +.38661a 20 5b 67 jsr $38675b JSR LOAD_FEEDBACK_ALGO +.38661d fa plx PLX +.38661e e6 67 inc $67 INC INSTR_ADDR +.386620 d0 02 bne $386624 BNE LD_INST_6 +.386622 e6 68 inc $68 INC INSTR_ADDR+1 +.386624 LD_INST_6 +.386624 20 77 67 jsr $386777 JSR LOAD_WAVE +.386627 c2 20 rep #$20 REP #$20 ; set A long +.386629 a5 67 lda $67 LDA INSTR_ADDR +.38662b 69 06 00 adc #$0006 ADC #6 +.38662e 85 67 sta $67 STA INSTR_ADDR +.386630 e2 20 sep #$20 SEP #$20 ; set A short +.386632 a0 a8 01 ldy #$01a8 LDY #5 * SCREEN_WIDTH + 24 +.386635 20 2f 58 jsr $38582f JSR WRITE_INSTRUMENT_NAME +.386638 DRUM_SET +.386638 60 rts RTS +.386639 LOAD_AM_VIB_MULT +.386639 a7 67 lda [$67] LDA [INSTR_ADDR] +.38663b 48 pha PHA +.38663c 48 pha PHA +.38663d 48 pha PHA +.38663e 48 pha PHA +.38663f 9f 20 e7 af sta $afe720,x STA @lOPL3_R_AM_VID_EG_KSR_MULT,X +.386643 29 80 and #$80 AND #TREMOLO +.386645 a0 3d 02 ldy #$023d LDY #7 * SCREEN_WIDTH + 13 +.386648 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.38664b 68 pla PLA +.38664c 29 40 and #$40 AND #VIBRATO +.38664e a0 8d 02 ldy #$028d LDY #8 * SCREEN_WIDTH + 13 +.386651 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.386654 68 pla PLA +.386655 29 20 and #$20 AND #SUSTAINING +.386657 a0 dd 02 ldy #$02dd LDY #9 * SCREEN_WIDTH + 13 +.38665a 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.38665d 68 pla PLA +.38665e 29 10 and #$10 AND #KSR +.386660 a0 2d 03 ldy #$032d LDY #10 * SCREEN_WIDTH + 13 +.386663 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.386666 68 pla PLA +.386667 29 0f and #$0f AND #MULTIPLIER +.386669 a0 7e 03 ldy #$037e LDY #11 * SCREEN_WIDTH + 14 +.38666c 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.38666f a0 06 00 ldy #$0006 LDY #6 +.386672 b7 67 lda [$67],y LDA [INSTR_ADDR], Y +.386674 48 pha PHA +.386675 48 pha PHA +.386676 48 pha PHA +.386677 48 pha PHA +.386678 9f 23 e7 af sta $afe723,x STA @lOPL3_R_AM_VID_EG_KSR_MULT + 3,X +.38667c 29 80 and #$80 AND #TREMOLO +.38667e a0 57 02 ldy #$0257 LDY #7 * SCREEN_WIDTH + 39 +.386681 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.386684 68 pla PLA +.386685 29 40 and #$40 AND #VIBRATO +.386687 a0 a7 02 ldy #$02a7 LDY #8 * SCREEN_WIDTH + 39 +.38668a 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.38668d 68 pla PLA +.38668e 29 20 and #$20 AND #SUSTAINING +.386690 a0 f7 02 ldy #$02f7 LDY #9 * SCREEN_WIDTH + 39 +.386693 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.386696 68 pla PLA +.386697 29 10 and #$10 AND #KSR +.386699 a0 47 03 ldy #$0347 LDY #10 * SCREEN_WIDTH + 39 +.38669c 20 e0 57 jsr $3857e0 JSR WRITE_OFF_ON +.38669f 68 pla PLA +.3866a0 29 0f and #$0f AND #MULTIPLIER +.3866a2 a0 98 03 ldy #$0398 LDY #11 * SCREEN_WIDTH + 40 +.3866a5 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866a8 60 rts RTS +.3866a9 LOAD_KEY_OP_LVL +.3866a9 a7 67 lda [$67] LDA [INSTR_ADDR] +.3866ab 48 pha PHA +.3866ac 9f 40 e7 af sta $afe740,x STA @lOPL3_R_KSL_TL,X +.3866b0 29 c0 and #$c0 AND #KEY_SCALE +.3866b2 2a rol a ROL A +.3866b3 2a rol a ROL A +.3866b4 2a rol a ROL A +.3866b5 a0 ce 03 ldy #$03ce LDY #12 * SCREEN_WIDTH + 14 +.3866b8 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866bb 68 pla PLA +.3866bc 29 3f and #$3f AND #OP_LEVEL +.3866be a0 1e 04 ldy #$041e LDY #13 * SCREEN_WIDTH + 14 +.3866c1 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866c4 a0 06 00 ldy #$0006 LDY #6 +.3866c7 b7 67 lda [$67],y LDA [INSTR_ADDR],Y +.3866c9 48 pha PHA +.3866ca 9f 43 e7 af sta $afe743,x STA @lOPL3_R_KSL_TL + 3,X +.3866ce 29 c0 and #$c0 AND #KEY_SCALE +.3866d0 2a rol a ROL A +.3866d1 2a rol a ROL A +.3866d2 2a rol a ROL A +.3866d3 a0 e8 03 ldy #$03e8 LDY #12 * SCREEN_WIDTH + 40 +.3866d6 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866d9 68 pla PLA +.3866da 29 3f and #$3f AND #OP_LEVEL +.3866dc a0 38 04 ldy #$0438 LDY #13 * SCREEN_WIDTH + 40 +.3866df 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866e2 60 rts RTS +.3866e3 LOAD_ATT_DEC_RATE +.3866e3 a7 67 lda [$67] LDA [INSTR_ADDR] +.3866e5 48 pha PHA +.3866e6 9f 60 e7 af sta $afe760,x STA @lOPL3_R_AR_DR,X +.3866ea 29 f0 and #$f0 AND #ATTACK_RT +.3866ec 4a lsr a LSR A +.3866ed 4a lsr a LSR A +.3866ee 4a lsr a LSR A +.3866ef 4a lsr a LSR A +.3866f0 a0 6e 04 ldy #$046e LDY #14 * SCREEN_WIDTH + 14 +.3866f3 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866f6 68 pla PLA +.3866f7 29 0f and #$0f AND #DECAY_RT +.3866f9 a0 be 04 ldy #$04be LDY #15 * SCREEN_WIDTH + 14 +.3866fc 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.3866ff a0 06 00 ldy #$0006 LDY #6 +.386702 b7 67 lda [$67],y LDA [INSTR_ADDR],Y +.386704 48 pha PHA +.386705 9f 63 e7 af sta $afe763,x STA @lOPL3_R_AR_DR + 3,X +.386709 29 f0 and #$f0 AND #ATTACK_RT +.38670b 4a lsr a LSR A +.38670c 4a lsr a LSR A +.38670d 4a lsr a LSR A +.38670e 4a lsr a LSR A +.38670f a0 88 04 ldy #$0488 LDY #14 * SCREEN_WIDTH + 40 +.386712 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386715 68 pla PLA +.386716 29 0f and #$0f AND #DECAY_RT +.386718 a0 d8 04 ldy #$04d8 LDY #15 * SCREEN_WIDTH + 40 +.38671b 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.38671e 60 rts RTS +.38671f LOAD_SUSTAIN_RELEASE_RATE +.38671f a7 67 lda [$67] LDA [INSTR_ADDR] +.386721 48 pha PHA +.386722 9f 80 e7 af sta $afe780,x STA @lOPL3_R_SL_RR,X +.386726 29 f0 and #$f0 AND #ATTACK_RT +.386728 4a lsr a LSR A +.386729 4a lsr a LSR A +.38672a 4a lsr a LSR A +.38672b 4a lsr a LSR A +.38672c a0 0e 05 ldy #$050e LDY #16 * SCREEN_WIDTH + 14 +.38672f 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386732 68 pla PLA +.386733 29 0f and #$0f AND #DECAY_RT +.386735 a0 5e 05 ldy #$055e LDY #17 * SCREEN_WIDTH + 14 +.386738 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.38673b a0 06 00 ldy #$0006 LDY #6 +.38673e b7 67 lda [$67],y LDA [INSTR_ADDR],Y +.386740 48 pha PHA +.386741 9f 83 e7 af sta $afe783,x STA @lOPL3_R_SL_RR + 3,X +.386745 29 f0 and #$f0 AND #ATTACK_RT +.386747 4a lsr a LSR A +.386748 4a lsr a LSR A +.386749 4a lsr a LSR A +.38674a 4a lsr a LSR A +.38674b a0 28 05 ldy #$0528 LDY #16 * SCREEN_WIDTH + 40 +.38674e 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386751 68 pla PLA +.386752 29 0f and #$0f AND #DECAY_RT +.386754 a0 78 05 ldy #$0578 LDY #17 * SCREEN_WIDTH + 40 +.386757 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.38675a 60 rts RTS +.38675b LOAD_FEEDBACK_ALGO +.38675b a7 67 lda [$67] LDA [INSTR_ADDR] +.38675d 48 pha PHA +.38675e 09 f0 ora #$f0 ORA #$F0 ; Channel B +.386760 9f c0 e7 af sta $afe7c0,x STA @lOPL3_R_FEEDBACK,X +.386764 29 0e and #$0e AND #FEEDBACK +.386766 4a lsr a LSR A +.386767 a0 68 06 ldy #$0668 LDY #20 * SCREEN_WIDTH + 40 +.38676a 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.38676d 68 pla PLA +.38676e 29 01 and #$01 AND #ALGORITHM +.386770 a0 b8 06 ldy #$06b8 LDY #21 * SCREEN_WIDTH + 40 +.386773 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386776 60 rts RTS +.386777 LOAD_WAVE +.386777 a7 67 lda [$67] LDA [INSTR_ADDR] +.386779 9f e0 e7 af sta $afe7e0,x STA @lOPL3_R_WAVE_SELECT,X +.38677d 29 07 and #$07 AND #$7 +.38677f a0 ae 05 ldy #$05ae LDY #18 * SCREEN_WIDTH + 14 +.386782 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386785 a0 05 00 ldy #$0005 LDY #5 +.386788 b7 67 lda [$67],y LDA [INSTR_ADDR],Y +.38678a 9f e3 e7 af sta $afe7e3,x STA @lOPL3_R_WAVE_SELECT+3,X +.38678e 29 07 and #$07 AND #$7 +.386790 a0 c8 05 ldy #$05c8 LDY #18 * SCREEN_WIDTH + 40 +.386793 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386796 60 rts RTS +.386797 INIT_KEYBOARD +.386797 0b phd PHD +.386798 48 pha PHA +.386799 da phx PHX +.38679a 08 php PHP +.38679b 18 clc CLC +.38679c e2 20 sep #$20 SEP #$20 ; set A short +.38679e a9 00 lda #$00 LDA #$00 +.3867a0 8d 87 0f sta $0f87 STA KEYBOARD_SC_FLG ; Clear the Keyboard Flag +.3867a3 20 45 68 jsr $386845 JSR Poll_Inbuf +.3867a6 a9 aa lda #$aa LDA #$AA ;Send self test command +.3867a8 8f 64 10 af sta $af1064 STA KBD_CMD_BUF +.3867ac 20 50 68 jsr $386850 JSR Poll_Outbuf ; +.3867af af 60 10 af lda $af1060 LDA KBD_OUT_BUF ;Check self test result +.3867b3 c9 55 cmp #$55 CMP #$55 +.3867b5 f0 03 beq $3867ba BEQ passAAtest +.3867b7 82 6f 00 brl $386829 BRL initkb_loop_out +.3867ba passAAtest +.3867ba a9 ab lda #$ab LDA #$AB ;Send test Interface command +.3867bc 8f 64 10 af sta $af1064 STA KBD_CMD_BUF +.3867c0 20 50 68 jsr $386850 JSR Poll_Outbuf ; +.3867c3 af 60 10 af lda $af1060 LDA KBD_OUT_BUF ;Display Interface test results +.3867c7 c9 00 cmp #$00 CMP #$00 ;Should be 00 +.3867c9 f0 03 beq $3867ce BEQ passABtest +.3867cb 82 5b 00 brl $386829 BRL initkb_loop_out +.3867ce passABtest +.3867ce a9 60 lda #$60 LDA #$60 ; Send Command 0x60 so to Enable Interrupt +.3867d0 8f 64 10 af sta $af1064 STA KBD_CMD_BUF +.3867d4 20 45 68 jsr $386845 JSR Poll_Inbuf ; +.3867d7 a9 69 lda #$69 LDA #%01101001 ; Enable Interrupt +.3867d9 8f 60 10 af sta $af1060 STA KBD_DATA_BUF +.3867dd 20 45 68 jsr $386845 JSR Poll_Inbuf ; +.3867e0 a9 ff lda #$ff LDA #$FF ; Send Keyboard Reset command +.3867e2 8f 60 10 af sta $af1060 STA KBD_DATA_BUF +.3867e6 a2 ff ff ldx #$ffff LDX #$FFFF +.3867e9 ca dex DLY_LOOP1 DEX +.3867ea ea nop NOP +.3867eb ea nop NOP +.3867ec ea nop NOP +.3867ed ea nop NOP +.3867ee ea nop NOP +.3867ef ea nop NOP +.3867f0 ea nop NOP +.3867f1 ea nop NOP +.3867f2 e0 00 00 cpx #$0000 CPX #$0000 +.3867f5 d0 f2 bne $3867e9 BNE DLY_LOOP1 +.3867f7 20 50 68 jsr $386850 JSR Poll_Outbuf ; +.3867fa af 60 10 af lda $af1060 LDA KBD_OUT_BUF ; Read Output Buffer +.3867fe DO_CMD_F4_AGAIN +.3867fe 20 45 68 jsr $386845 JSR Poll_Inbuf ; +.386801 a9 f4 lda #$f4 LDA #$F4 ; Enable the Keyboard +.386803 8f 60 10 af sta $af1060 STA KBD_DATA_BUF +.386807 20 50 68 jsr $386850 JSR Poll_Outbuf ; +.38680a af 60 10 af lda $af1060 LDA KBD_OUT_BUF ; Clear the Output buffer +.38680e c9 fa cmp #$fa CMP #$FA +.386810 d0 ec bne $3867fe BNE DO_CMD_F4_AGAIN +.386812 20 5b 68 jsr $38685b JSR INIT_MOUSE +.386815 af 40 01 00 lda $000140 LDA @lINT_PENDING_REG0 ; Read the Pending Register & +.386819 29 80 and #$80 AND #FNX0_INT07_MOUSE +.38681b 8f 40 01 00 sta $000140 STA @lINT_PENDING_REG0 ; Writing it back will clear the Active Bit +.38681f af 41 01 00 lda $000141 LDA @lINT_PENDING_REG1 ; Read the Pending Register & +.386823 29 01 and #$01 AND #FNX1_INT00_KBD +.386825 8f 41 01 00 sta $000141 STA @lINT_PENDING_REG1 ; Writing it back will clear the Active Bit +.386829 initkb_loop_out +.386829 InitSuccess +.386829 28 plp PLP +.38682a fa plx PLX +.38682b 68 pla PLA +.38682c 2b pld PLD +.38682d 60 rts RTS +.38682e INIT_MOUSEPOINTER +.38682e c2 30 rep #$30 REP #$30 ; set A&X long +.386830 a2 80 4d ldx #$4d80 LDX #<>MOUSE_POINTER_PTR +.386833 a9 00 01 lda #$0100 LDA #$100 +.386836 a0 00 05 ldy #$0500 LDY #$0500 +.386839 54 af 38 mvn #$38,#$af MVN #`MOUSE_POINTER_PTR,#$AF +.38683c e2 20 sep #$20 SEP #$20 ; set A short +.38683e a9 01 lda #$01 LDA #$01 +.386840 8f 00 07 af sta $af0700 STA @lMOUSE_PTR_CTRL_REG_L ; Enable Mouse, Mouse Pointer Graphic Bank 0 +.386844 60 rts RTS +.386845 Poll_Inbuf +.386845 af 64 10 af lda $af1064 LDA STATUS_PORT ; Load Status Byte +.386849 29 02 and #$02 AND #38691d 01 01 01 01 01 01 01 01 CHANNELS .byte 1,1,1,1,1,1,1,1,1 +>386925 01 +.386926 TOGGLE_CHANNEL +.386926 aa tax TAX +.386927 ca dex DEX +.386928 bf 1d 69 38 lda $38691d,x LDA CHANNELS,X +.38692c 49 01 eor #$01 EOR #1 +.38692e 9f 1d 69 38 sta $38691d,x STA CHANNELS,X +.386932 60 rts RTS +>386933 80 80 80 31 33 80 36 38 SCAN_TO_NOTE .text $80, $80, $80, $31, $33, $80, $36, $38, $3A, $80, $41, $80, $80, $80, $80, $80 +>38693b 3a 80 41 80 80 80 80 80 +>386943 2c 32 34 35 37 39 3b 3c .text $2C, $32, $34, $35, $37, $39, $3B, $3C, $42, $80, $80, $80, $80, $80, $80, $21 +>38694b 42 80 80 80 80 80 80 21 +>386953 23 80 26 28 2a 80 80 80 .text $23, $80, $26, $28, $2A, $80, $80, $80, $80, $80, $80, $80, $1C, $22, $24, $25 +>38695b 80 80 80 80 1c 22 24 25 +>386963 27 29 2b 80 80 80 80 80 .text $27, $29, $2B, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80 +>38696b 80 80 80 80 80 80 80 80 +>386973 80 80 80 80 80 80 80 80 .text $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80 +>38697b 80 80 80 80 80 80 80 80 +>386983 80 80 80 80 80 80 80 80 .text $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80, $80 +>38698b 80 80 80 80 80 80 80 80 +.386993 MIDI_COMMAND_TABLE +>386993 02 56 02 56 .word <>NOTE_OFF, <>NOTE_ON +>386997 82 56 82 56 .word <>POLY_PRESSURE, <>CONTROL_CHANGE +>38699b ab 56 ab 56 .word <>PROGRAM_CHANGE, <>CHANNEL_PRESSURE ; these two command expect 1 datat byte only - no running status +>38699f 82 56 c2 56 .word <>PITCH_BEND, <>SYSTEM_COMMAND +>3869a3 da 56 .word <>INVALID_COMMAND ;****** Processing file: file_load.asm -.38693a LOAD_FILE_DISPLAY -.38693a c2 10 rep #$10 REP #$10 ; set X long -.38693c a9 02 lda #$02 LDA #2 -.38693e 8f 15 0f 38 sta $380f15 STA STATE_MACHINE -.386942 22 82 5c 38 jsl $385c82 JSL ISDOS_INIT -.386946 LOAD_DIRECTORY -.386946 a9 00 lda #$00 LDA #0 -.386948 8d 1f 03 sta $031f STA SDOS_LINE_SELECT -.38694b a9 34 lda #$34 LDA #`SDCARD_LIST -.38694d 85 53 sta $53 STA SDOS_FILE_REC_PTR+2 -.38694f 64 52 stz $52 STZ SDOS_FILE_REC_PTR+1 -.386951 64 51 stz $51 STZ SDOS_FILE_REC_PTR -.386953 20 5f 69 jsr $38695f JSR LOAD_SDCARD_DATA -.386956 20 8a 69 jsr $38698a JSR SHOW_FILE_MENU -.386959 20 d0 69 jsr $3869d0 JSR POPULATE_FILES -.38695c e2 10 sep #$10 SEP #$10 ; set X short -.38695e 6b rtl RTL -.38695f LOAD_SDCARD_DATA -.38695f a9 00 lda #$00 LDA #0 -.386961 a0 00 04 ldy #$0400 LDY #1024 ; each struct is 18 bytes long, so this allows to load a 64 entries directory -.386964 CLEAR_FILE_AREA -.386964 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR], Y -.386966 88 dey DEY -.386967 d0 fb bne $386964 BNE CLEAR_FILE_AREA -.386969 a5 3f lda $3f LDA SDCARD_PRSNT_MNT -.38696b f0 1c beq $386989 BEQ LOAD_SDCARD_DATA_DONE ; if SD not present, exit -.38696d 22 e8 5c 38 jsl $385ce8 JSL ISDOS_READ_MBR_BOOT -.386971 22 bf 5f 38 jsl $385fbf JSL ISDOS_PARSE_ROOT_DIR -.386975 c2 20 rep #$20 REP #$20 ; set A long -.386977 a9 00 66 lda #$6600 LDA #FAT_DATA -.38697a 85 80 sta $80 STA SD_DATA -.38697c a9 00 00 lda #$0000 LDA #0 -.38697f 85 82 sta $82 STA SD_DATA + 2 -.386981 85 86 sta $86 STA SD_DATA_FAT_PAGE -.386983 22 6b 60 38 jsl $38606b JSL ISDOS_READ_FAT_SECTOR -.386987 e2 20 sep #$20 SEP #$20 ; set A short -.386989 LOAD_SDCARD_DATA_DONE -.386989 60 rts RTS -.38698a SHOW_FILE_MENU -.38698a c2 30 rep #$30 REP #$30 ; set A&X long -.38698c a9 00 a0 lda #$a000 LDA #<>CS_TEXT_MEM_PTR ; store the initial screen buffer location -.38698f 85 0c sta $0c STA SCREENBEGIN -.386991 a9 00 c0 lda #$c000 LDA #<>CS_COLOR_MEM_PTR ; store the initial colour buffer location -.386994 85 17 sta $17 STA CURSORPOS -.386996 e2 20 sep #$20 SEP #$20 ; set A short -.386998 a9 af lda #$af LDA #`CS_TEXT_MEM_PTR -.38699a 85 0e sta $0e STA SCREENBEGIN+2 -.38699c 85 19 sta $19 STA CURSORPOS+2 -.38699e a0 3e 03 ldy #$033e LDY #SCREEN_WIDTH * 10 + 30 -.3869a1 a9 28 lda #$28 LDA #40 ; lines to copy -.3869a3 85 80 sta $80 STA LINE_COPY -.3869a5 a2 8f 03 ldx #$038f LDX #SCREEN_WIDTH * 11 + 31 ; initialize the cursor position for file display -.3869a8 86 1a stx $1a STX CURSORX -.3869aa a2 00 00 ldx #$0000 LDX #0 -.3869ad a9 14 lda #$14 COPY_LINE LDA #20 ; columns to copy -.3869af 85 81 sta $81 STA CHAR_COPY -.3869b1 bf 80 4e 38 lda $384e80,x COPY_CHAR LDA FILE_LOAD_SCREEN,X -.3869b5 97 0c sta [$0c],y STA [SCREENBEGIN],Y -.3869b7 a9 50 lda #$50 LDA #$50 ; yellow -.3869b9 97 17 sta [$17],y STA [CURSORPOS],Y -.3869bb c8 iny INY -.3869bc e8 inx INX -.3869bd c6 81 dec $81 DEC CHAR_COPY -.3869bf d0 f0 bne $3869b1 BNE COPY_CHAR -.3869c1 c2 20 rep #$20 REP #$20 ; set A long -.3869c3 98 tya TYA -.3869c4 18 clc CLC -.3869c5 69 3c 00 adc #$003c ADC #SCREEN_WIDTH - 20 ; skip to next line -.3869c8 a8 tay TAY -.3869c9 e2 20 sep #$20 SEP #$20 ; set A short -.3869cb c6 80 dec $80 DEC LINE_COPY -.3869cd d0 de bne $3869ad BNE COPY_LINE -.3869cf 60 rts RTS -.3869d0 POPULATE_FILES -.3869d0 64 51 stz $51 STZ SDOS_FILE_REC_PTR -.3869d2 64 52 stz $52 STZ SDOS_FILE_REC_PTR+1 -.3869d4 a9 34 lda #$34 LDA #`SDCARD_LIST -.3869d6 85 53 sta $53 STA SDOS_FILE_REC_PTR+2 -.3869d8 a2 00 00 ldx #$0000 LDX #0 -.3869db PF_NEXT_FILE -.3869db a0 0b 00 ldy #$000b LDY #11 -.3869de b7 51 lda [$51],y LDA [SDOS_FILE_REC_PTR],Y -.3869e0 f0 24 beq $386a06 BEQ PF_DONE -.3869e2 22 c3 5b 38 jsl $385bc3 JSL DISPLAY_FAT_RECORD -.3869e6 c2 20 rep #$20 REP #$20 ; set A long -.3869e8 a5 1a lda $1a LDA CURSORX -.3869ea 18 clc CLC -.3869eb 69 3e 00 adc #$003e ADC #SCREEN_WIDTH - 18 -.3869ee 85 1a sta $1a STA CURSORX -.3869f0 a5 51 lda $51 LDA SDOS_FILE_REC_PTR -.3869f2 69 12 00 adc #$0012 ADC #18 -.3869f5 85 51 sta $51 STA SDOS_FILE_REC_PTR -.3869f7 c9 80 04 cmp #$0480 CMP #1152 -.3869fa b0 0a bcs $386a06 BCS PF_DONE -.3869fc e8 inx INX -.3869fd e0 26 00 cpx #$0026 CPX #38 -.386a00 f0 04 beq $386a06 BEQ PF_DONE -.386a02 e2 20 sep #$20 SEP #$20 ; set A short -.386a04 80 d5 bra $3869db BRA PF_NEXT_FILE -.386a06 PF_DONE -.386a06 e2 20 sep #$20 SEP #$20 ; set A short -.386a08 a9 05 lda #$05 LDA #5 ; Yellow Background -.386a0a 22 25 5c 38 jsl $385c25 JSL TEXT_COLOUR_SELECTED -.386a0e 60 rts RTS -.386a0f READ_FILE -.386a0f a9 00 lda #$00 LDA #0 -.386a11 eb xba XBA -.386a12 ad 1f 03 lda $031f LDA SDOS_LINE_SELECT -.386a15 c2 30 rep #$30 REP #$30 ; set A&X long -.386a17 8d 00 01 sta $0100 STA UNSIGNED_MULT_A -.386a1a a9 12 00 lda #$0012 LDA #18 -.386a1d 8d 02 01 sta $0102 STA UNSIGNED_MULT_B -.386a20 ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT -.386a23 85 51 sta $51 STA SDOS_FILE_REC_PTR -.386a25 a9 00 80 lda #$8000 LDA #<>RAD_FILE_TEMP -.386a28 85 80 sta $80 STA SD_DATA -.386a2a a9 37 00 lda #$0037 LDA #`RAD_FILE_TEMP -.386a2d 85 82 sta $82 STA SD_DATA + 2 -.386a2f a0 10 00 ldy #$0010 LDY #16 -.386a32 b7 51 lda [$51],y LDA [SDOS_FILE_REC_PTR],Y -.386a34 22 39 61 38 jsl $386139 JSL ISDOS_READ_FILE -.386a38 e2 20 sep #$20 SEP #$20 ; set A short -.386a3a 22 b1 30 38 jsl $3830b1 JSL OPL2_INIT -.386a3e 22 6b 6a 38 jsl $386a6b JSL RAD_INIT_PLAYER -.386a42 22 47 6a 38 jsl $386a47 JSL EXIT_FILE -.386a46 6b rtl RTL -.386a47 EXIT_FILE -.386a47 20 79 64 jsr $386479 JSR RESET_STATE_MACHINE -.386a4a 20 db 56 jsr $3856db JSR DRAW_DISPLAY -.386a4d 20 59 59 jsr $385959 JSR DISPLAY_FILENAME -.386a50 20 61 58 jsr $385861 JSR DISPLAY_PATTERN -.386a53 20 2b 5b jsr $385b2b JSR DISPLAY_ORDERS -.386a56 20 af 5a jsr $385aaf JSR DISPLAY_SPEED -.386a59 6b rtl RTL +.3869a5 LOAD_FILE_DISPLAY +.3869a5 c2 10 rep #$10 REP #$10 ; set X long +.3869a7 a9 02 lda #$02 LDA #2 +.3869a9 8f 15 0f 38 sta $380f15 STA STATE_MACHINE +.3869ad 22 74 5c 38 jsl $385c74 JSL ISDOS_INIT +.3869b1 LOAD_DIRECTORY +.3869b1 a9 00 lda #$00 LDA #0 +.3869b3 8d 1f 03 sta $031f STA SDOS_LINE_SELECT +.3869b6 a9 34 lda #$34 LDA #`SDCARD_LIST +.3869b8 85 53 sta $53 STA SDOS_FILE_REC_PTR+2 +.3869ba 64 52 stz $52 STZ SDOS_FILE_REC_PTR+1 +.3869bc 64 51 stz $51 STZ SDOS_FILE_REC_PTR +.3869be 20 ca 69 jsr $3869ca JSR LOAD_SDCARD_DATA +.3869c1 20 f5 69 jsr $3869f5 JSR SHOW_FILE_MENU +.3869c4 20 3b 6a jsr $386a3b JSR POPULATE_FILES +.3869c7 e2 10 sep #$10 SEP #$10 ; set X short +.3869c9 6b rtl RTL +.3869ca LOAD_SDCARD_DATA +.3869ca a9 00 lda #$00 LDA #0 +.3869cc a0 00 04 ldy #$0400 LDY #1024 ; each struct is 18 bytes long, so this allows to load a 64 entries directory +.3869cf CLEAR_FILE_AREA +.3869cf 97 51 sta [$51],y STA [SDOS_FILE_REC_PTR], Y +.3869d1 88 dey DEY +.3869d2 d0 fb bne $3869cf BNE CLEAR_FILE_AREA +.3869d4 a5 3f lda $3f LDA SDCARD_PRSNT_MNT +.3869d6 f0 1c beq $3869f4 BEQ LOAD_SDCARD_DATA_DONE ; if SD not present, exit +.3869d8 22 d7 5c 38 jsl $385cd7 JSL ISDOS_READ_MBR_AND_BOOT_SECTOR +.3869dc 22 d3 5f 38 jsl $385fd3 JSL ISDOS_PARSE_ROOT_DIR +.3869e0 c2 20 rep #$20 REP #$20 ; set A long +.3869e2 a9 00 66 lda #$6600 LDA #FAT_DATA +.3869e5 85 80 sta $80 STA SD_DATA +.3869e7 a9 00 00 lda #$0000 LDA #0 +.3869ea 85 82 sta $82 STA SD_DATA + 2 +.3869ec 85 86 sta $86 STA SD_DATA_FAT_PAGE +.3869ee 22 7f 60 38 jsl $38607f JSL ISDOS_READ_FAT_SECTOR +.3869f2 e2 20 sep #$20 SEP #$20 ; set A short +.3869f4 LOAD_SDCARD_DATA_DONE +.3869f4 60 rts RTS +.3869f5 SHOW_FILE_MENU +.3869f5 c2 30 rep #$30 REP #$30 ; set A&X long +.3869f7 a9 00 a0 lda #$a000 LDA #<>CS_TEXT_MEM_PTR ; store the initial screen buffer location +.3869fa 85 0c sta $0c STA SCREENBEGIN +.3869fc a9 00 c0 lda #$c000 LDA #<>CS_COLOR_MEM_PTR ; store the initial colour buffer location +.3869ff 85 17 sta $17 STA CURSORPOS +.386a01 e2 20 sep #$20 SEP #$20 ; set A short +.386a03 a9 af lda #$af LDA #`CS_TEXT_MEM_PTR +.386a05 85 0e sta $0e STA SCREENBEGIN+2 +.386a07 85 19 sta $19 STA CURSORPOS+2 +.386a09 a0 3e 03 ldy #$033e LDY #SCREEN_WIDTH * 10 + 30 +.386a0c a9 28 lda #$28 LDA #40 ; lines to copy +.386a0e 85 80 sta $80 STA LINE_COPY +.386a10 a2 8f 03 ldx #$038f LDX #SCREEN_WIDTH * 11 + 31 ; initialize the cursor position for file display +.386a13 86 1a stx $1a STX CURSORX +.386a15 a2 00 00 ldx #$0000 LDX #0 +.386a18 a9 14 lda #$14 COPY_LINE LDA #20 ; columns to copy +.386a1a 85 81 sta $81 STA CHAR_COPY +.386a1c bf 80 4e 38 lda $384e80,x COPY_CHAR LDA FILE_LOAD_SCREEN,X +.386a20 97 0c sta [$0c],y STA [SCREENBEGIN],Y +.386a22 a9 50 lda #$50 LDA #$50 ; yellow +.386a24 97 17 sta [$17],y STA [CURSORPOS],Y +.386a26 c8 iny INY +.386a27 e8 inx INX +.386a28 c6 81 dec $81 DEC CHAR_COPY +.386a2a d0 f0 bne $386a1c BNE COPY_CHAR +.386a2c c2 20 rep #$20 REP #$20 ; set A long +.386a2e 98 tya TYA +.386a2f 18 clc CLC +.386a30 69 3c 00 adc #$003c ADC #SCREEN_WIDTH - 20 ; skip to next line +.386a33 a8 tay TAY +.386a34 e2 20 sep #$20 SEP #$20 ; set A short +.386a36 c6 80 dec $80 DEC LINE_COPY +.386a38 d0 de bne $386a18 BNE COPY_LINE +.386a3a 60 rts RTS +.386a3b POPULATE_FILES +.386a3b 64 51 stz $51 STZ SDOS_FILE_REC_PTR +.386a3d 64 52 stz $52 STZ SDOS_FILE_REC_PTR+1 +.386a3f a9 34 lda #$34 LDA #`SDCARD_LIST +.386a41 85 53 sta $53 STA SDOS_FILE_REC_PTR+2 +.386a43 a2 00 00 ldx #$0000 LDX #0 +.386a46 PF_NEXT_FILE +.386a46 a0 0b 00 ldy #$000b LDY #11 +.386a49 b7 51 lda [$51],y LDA [SDOS_FILE_REC_PTR],Y +.386a4b f0 24 beq $386a71 BEQ PF_DONE +.386a4d 22 b5 5b 38 jsl $385bb5 JSL DISPLAY_FAT_RECORD +.386a51 c2 20 rep #$20 REP #$20 ; set A long +.386a53 a5 1a lda $1a LDA CURSORX +.386a55 18 clc CLC +.386a56 69 3e 00 adc #$003e ADC #SCREEN_WIDTH - 18 +.386a59 85 1a sta $1a STA CURSORX +.386a5b a5 51 lda $51 LDA SDOS_FILE_REC_PTR +.386a5d 69 12 00 adc #$0012 ADC #18 +.386a60 85 51 sta $51 STA SDOS_FILE_REC_PTR +.386a62 c9 80 04 cmp #$0480 CMP #1152 +.386a65 b0 0a bcs $386a71 BCS PF_DONE +.386a67 e8 inx INX +.386a68 e0 26 00 cpx #$0026 CPX #38 +.386a6b f0 04 beq $386a71 BEQ PF_DONE +.386a6d e2 20 sep #$20 SEP #$20 ; set A short +.386a6f 80 d5 bra $386a46 BRA PF_NEXT_FILE +.386a71 PF_DONE +.386a71 e2 20 sep #$20 SEP #$20 ; set A short +.386a73 a9 05 lda #$05 LDA #5 ; Yellow Background +.386a75 22 17 5c 38 jsl $385c17 JSL TEXT_COLOUR_SELECTED +.386a79 60 rts RTS +.386a7a READ_FILE +.386a7a a9 00 lda #$00 LDA #0 +.386a7c eb xba XBA +.386a7d ad 1f 03 lda $031f LDA SDOS_LINE_SELECT +.386a80 c2 30 rep #$30 REP #$30 ; set A&X long +.386a82 8d 00 01 sta $0100 STA UNSIGNED_MULT_A +.386a85 a9 12 00 lda #$0012 LDA #18 +.386a88 8d 02 01 sta $0102 STA UNSIGNED_MULT_B +.386a8b ad 04 01 lda $0104 LDA UNSIGNED_MULT_RESULT +.386a8e 85 51 sta $51 STA SDOS_FILE_REC_PTR +.386a90 a9 00 80 lda #$8000 LDA #<>RAD_FILE_TEMP +.386a93 85 80 sta $80 STA SD_DATA +.386a95 a9 37 00 lda #$0037 LDA #`RAD_FILE_TEMP +.386a98 85 82 sta $82 STA SD_DATA + 2 +.386a9a a0 10 00 ldy #$0010 LDY #16 +.386a9d b7 51 lda [$51],y LDA [SDOS_FILE_REC_PTR],Y +.386a9f 22 5f 61 38 jsl $38615f JSL ISDOS_READ_FILE +.386aa3 e2 20 sep #$20 SEP #$20 ; set A short +.386aa5 22 b1 30 38 jsl $3830b1 JSL OPL3_INIT +.386aa9 22 d6 6a 38 jsl $386ad6 JSL RAD_INIT_PLAYER +.386aad 22 b2 6a 38 jsl $386ab2 JSL EXIT_FILE +.386ab1 6b rtl RTL +.386ab2 EXIT_FILE +.386ab2 20 e4 64 jsr $3864e4 JSR RESET_STATE_MACHINE +.386ab5 20 db 56 jsr $3856db JSR DRAW_DISPLAY +.386ab8 20 4b 59 jsr $38594b JSR DISPLAY_FILENAME +.386abb 20 53 58 jsr $385853 JSR DISPLAY_PATTERN +.386abe 20 1d 5b jsr $385b1d JSR DISPLAY_ORDERS +.386ac1 20 a1 5a jsr $385aa1 JSR DISPLAY_SPEED +.386ac4 6b rtl RTL ;****** Return to file: tracker.asm @@ -7247,783 +7327,783 @@ >0001 00 songLength .byte $00 >0002 06 InitialSpeed .byte $06 >0003 00 hasSlowTimer .byte $00 ;BOOL $00 = False, $01 = True ->386a5a 43 90 44 91 45 46 92 47 note_array .byte $43, $90, $44, $91, $45, $46, $92, $47, $93, $41, $94, $42, $43 ->386a62 93 41 94 42 43 -.386a67 TuneInfo ->386a67 00 version .byte $00 ; bit 1 is RAD 1, bit 2 is RAD 2 ->386a68 00 songLength .byte $00 ->386a69 06 InitialSpeed .byte $06 ->386a6a 00 hasSlowTimer .byte $00 ;BOOL $00 = False, $01 = True -.386a6b RAD_INIT_PLAYER -.386a6b 22 b1 30 38 jsl $3830b1 JSL OPL2_INIT ; Init OPL2 -.386a6f 20 97 6c jsr $386c97 JSR RAD_ALL_NOTES_OFF -.386a72 a2 00 00 ldx #$0000 LDX #0 -.386a75 a9 00 lda #$00 LDA #0 -.386a77 RI_RESET -.386a77 9f 00 00 39 sta $390000,x STA PATTERNS,X -.386a7b e8 inx INX -.386a7c d0 f9 bne $386a77 BNE RI_RESET -.386a7e c2 30 rep #$30 REP #$30 ; set A&X long -.386a80 a9 00 80 lda #$8000 LDA #<>RAD_FILE_TEMP ; Set the Pointer where the File Begins -.386a83 85 08 sta $08 STA OPL2_ADDY_PTR_LO; -.386a85 a9 37 00 lda #$0037 LDA #<`RAD_FILE_TEMP -.386a88 85 0a sta $0a STA OPL2_ADDY_PTR_HI; -.386a8a e2 20 sep #$20 SEP #$20 ; set A short -.386a8c a0 10 00 ldy #$0010 LDY #$0010 -.386a8f b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386a91 c9 10 cmp #$10 CMP #$10 ; BCD version 1.0 or 2.1 -.386a93 d0 05 bne $386a9a BNE RI_LOAD_VERSION_21 -.386a95 22 f7 6a 38 jsl $386af7 JSL READ_VERSION_10 -.386a99 6b rtl RTL ; End of RAD_INIT_PLAYER -.386a9a RI_LOAD_VERSION_21 -.386a9a c9 21 cmp #$21 CMP #$21 -.386a9c d0 04 bne $386aa2 BNE RI_INVALID -.386a9e 22 a3 6a 38 jsl $386aa3 JSL READ_VERSION_21 -.386aa2 RI_INVALID -.386aa2 6b rtl RTL ; End of RAD_INIT_PLAYER -.386aa3 READ_VERSION_21 -.386aa3 a9 02 lda #$02 LDA #2 -.386aa5 8f 67 6a 38 sta $386a67 STA @lTuneInfo.version -.386aa9 20 b0 6a jsr $386ab0 JSR READ_TIMER -.386aac 20 82 6b jsr $386b82 JSR PARSER_RAD_FILE_INSTRUMENT_21; Parse the Instrument -.386aaf 6b rtl RTL ; End of READ_VERSION_21 -.386ab0 READ_TIMER -.386ab0 a0 11 00 ldy #$0011 LDY #$11 -.386ab3 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386ab5 89 40 bit #$40 BIT #$40 -.386ab7 f0 17 beq $386ad0 BEQ RT_NOT_SLOW -.386ab9 a9 01 lda #$01 LDA #1 -.386abb 8f 6a 6a 38 sta $386a6a STA @lTuneInfo.hasSlowTimer -.386abf a9 0f lda #$0f LDA #SLOW_TIMER -.386ac6 8d 66 01 sta $0166 STA TIMER0_CMP_M -.386ac9 a9 0c lda #$0c LDA #<`SLOW_TIMER -.386acb 8d 67 01 sta $0167 STA TIMER0_CMP_H -.386ace 80 23 bra $386af3 BRA SET_TIMER -.386ad0 RT_NOT_SLOW -.386ad0 89 20 bit #$20 BIT #$20 -.386ad2 f0 0a beq $386ade BEQ RT_NOT_BPM -.386ad4 c8 iny INY -.386ad5 c2 20 rep #$20 REP #$20 ; set A long -.386ad7 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386ad9 e2 20 sep #$20 SEP #$20 ; set A short -.386adb c8 iny INY -.386adc 80 15 bra $386af3 BRA SET_TIMER -.386ade RT_NOT_BPM -.386ade a9 00 lda #$00 LDA #0 -.386ae0 8f 6a 6a 38 sta $386a6a STA @lTuneInfo.hasSlowTimer -.386ae4 a9 98 lda #$98 LDA #FIFTY_HZ_COUNT -.386aeb 8d 66 01 sta $0166 STA TIMER0_CMP_M -.386aee a9 04 lda #$04 LDA #<`FIFTY_HZ_COUNT -.386af0 8d 67 01 sta $0167 STA TIMER0_CMP_H -.386af3 SET_TIMER -.386af3 20 0f 65 jsr $38650f JSR INIT_TIMER0 -.386af6 60 rts RTS -.386af7 READ_VERSION_10 -.386af7 a9 01 lda #$01 LDA #1 -.386af9 8f 67 6a 38 sta $386a67 STA @lTuneInfo.version -.386afd 20 15 6b jsr $386b15 JSR PARSER_RAD_FILE_INSTRUMENT_10; Parse the Instrument -.386b00 20 95 6b jsr $386b95 JSR PROCESS_ORDER_LIST_10 ; Parse the Order List -.386b03 20 ba 6b jsr $386bba JSR READ_PATTERNS_10 -.386b06 20 b0 6a jsr $386ab0 JSR READ_TIMER -.386b09 6b rtl RTL ; End of READ_VERSION_10 ->386b0a 07 01 08 02 09 03 0a 04 ADLIB_OFFSETS .byte 7,1,8,2,9,3,10,4,5,11,6 ->386b12 05 0b 06 -.386b15 PARSER_RAD_FILE_INSTRUMENT_10 -.386b15 c8 iny INY ; $11 bit 7: description, bit6: slow timer, bits4..0: speed -.386b16 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386b18 29 1f and #$1f AND #$1F -.386b1a 8f 69 6a 38 sta $386a69 STA @lTuneInfo.InitialSpeed +>386ac5 43 90 44 91 45 46 92 47 note_array .byte $43, $90, $44, $91, $45, $46, $92, $47, $93, $41, $94, $42, $43 +>386acd 93 41 94 42 43 +.386ad2 TuneInfo +>386ad2 00 version .byte $00 ; bit 1 is RAD 1, bit 2 is RAD 2 +>386ad3 00 songLength .byte $00 +>386ad4 06 InitialSpeed .byte $06 +>386ad5 00 hasSlowTimer .byte $00 ;BOOL $00 = False, $01 = True +.386ad6 RAD_INIT_PLAYER +.386ad6 22 b1 30 38 jsl $3830b1 JSL OPL3_INIT ; Init OPL3 +.386ada 20 02 6d jsr $386d02 JSR RAD_ALL_NOTES_OFF +.386add a2 00 00 ldx #$0000 LDX #0 +.386ae0 a9 00 lda #$00 LDA #0 +.386ae2 RI_RESET +.386ae2 9f 00 00 39 sta $390000,x STA PATTERNS,X +.386ae6 e8 inx INX +.386ae7 d0 f9 bne $386ae2 BNE RI_RESET +.386ae9 c2 30 rep #$30 REP #$30 ; set A&X long +.386aeb a9 00 80 lda #$8000 LDA #<>RAD_FILE_TEMP ; Set the Pointer where the File Begins +.386aee 85 08 sta $08 STA OPL2_ADDY_PTR_LO; +.386af0 a9 37 00 lda #$0037 LDA #<`RAD_FILE_TEMP +.386af3 85 0a sta $0a STA OPL2_ADDY_PTR_HI; +.386af5 e2 20 sep #$20 SEP #$20 ; set A short +.386af7 a0 10 00 ldy #$0010 LDY #$0010 +.386afa b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386afc c9 10 cmp #$10 CMP #$10 ; BCD version 1.0 or 2.1 +.386afe d0 05 bne $386b05 BNE RI_LOAD_VERSION_21 +.386b00 22 62 6b 38 jsl $386b62 JSL READ_VERSION_10 +.386b04 6b rtl RTL ; End of RAD_INIT_PLAYER +.386b05 RI_LOAD_VERSION_21 +.386b05 c9 21 cmp #$21 CMP #$21 +.386b07 d0 04 bne $386b0d BNE RI_INVALID +.386b09 22 0e 6b 38 jsl $386b0e JSL READ_VERSION_21 +.386b0d RI_INVALID +.386b0d 6b rtl RTL ; End of RAD_INIT_PLAYER +.386b0e READ_VERSION_21 +.386b0e a9 02 lda #$02 LDA #2 +.386b10 8f d2 6a 38 sta $386ad2 STA @lTuneInfo.version +.386b14 20 1b 6b jsr $386b1b JSR READ_TIMER +.386b17 20 ed 6b jsr $386bed JSR PARSER_RAD_FILE_INSTRUMENT_21; Parse the Instrument +.386b1a 6b rtl RTL ; End of READ_VERSION_21 +.386b1b READ_TIMER +.386b1b a0 11 00 ldy #$0011 LDY #$11 .386b1e b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386b20 29 80 and #$80 AND #$80 -.386b22 f0 07 beq $386b2b BEQ READ_INSTR_DATA -.386b24 Not_Done_With_Description -.386b24 c8 iny INY ; Move the Pointer Forward -.386b25 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386b27 c9 00 cmp #$00 CMP #$00 ; Check for the End of Text -.386b29 d0 f9 bne $386b24 BNE Not_Done_With_Description -.386b2b READ_INSTR_DATA -.386b2b c8 iny INY ; This points after either After Description or next to Offset 0x11 -.386b2c a9 38 lda #$38 LDA #<`INSTRUMENT_ACCORDN -.386b2e 85 f2 sta $f2 STA RAD_ADDR + 2 -.386b30 ProcessNextInstruments_10 -.386b30 e2 20 sep #$20 SEP #$20 ; set A short -.386b32 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Instrument Number -.386b34 f0 4a beq $386b80 BEQ DoneProcessingInstrument_10 -.386b36 c2 20 rep #$20 REP #$20 ; set A long -.386b38 3a dec a DEC A -.386b39 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.386b3d a9 16 00 lda #$0016 LDA #INSTR_REC_LEN -.386b40 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.386b44 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT ; not sure why this one requires a long address - bank is still 0 -.386b48 18 clc CLC -.386b49 69 3b 10 adc #$103b ADC #<>INSTRUMENT_ACCORDN -.386b4c 85 f0 sta $f0 STA RAD_ADDR -.386b4e a9 00 00 lda #$0000 LDA #0 -.386b51 e2 20 sep #$20 SEP #$20 ; set A short -.386b53 c8 iny INY -.386b54 64 4e stz $4e STZ RAD_TEMP -.386b56 87 f0 sta [$f0] STA [RAD_ADDR] ; Not a drum instrument -.386b58 Transfer_Instrument_Info -.386b58 a6 4e ldx $4e LDX RAD_TEMP -.386b5a bf 0a 6b 38 lda $386b0a,x LDA ADLIB_OFFSETS,X ; RAD uses a different order for registers -.386b5e aa tax TAX -.386b5f b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Register -.386b61 5a phy PHY -.386b62 9b txy TXY -.386b63 97 f0 sta [$f0],y STA [RAD_ADDR],Y ; Write to the instrument table -.386b65 7a ply PLY -.386b66 c8 iny INY -.386b67 e6 4e inc $4e INC RAD_TEMP -.386b69 a5 4e lda $4e LDA RAD_TEMP -.386b6b c9 0b cmp #$0b CMP #11 -.386b6d 90 e9 bcc $386b58 BCC Transfer_Instrument_Info -.386b6f 5a phy PHY ; store the position in the file on the stack -.386b70 a0 0c 00 ldy #$000c LDY #12 ; beginning of text -.386b73 a9 20 lda #$20 LDA #$20 -.386b75 BLANK_INSTR_DESCR -.386b75 97 f0 sta [$f0],y STA [RAD_ADDR],Y -.386b77 c8 iny INY -.386b78 c0 16 00 cpy #$0016 CPY #22 -.386b7b d0 f8 bne $386b75 BNE BLANK_INSTR_DESCR -.386b7d 7a ply PLY -.386b7e 80 b0 bra $386b30 BRA ProcessNextInstruments_10 -.386b80 DoneProcessingInstrument_10 -.386b80 c8 iny INY -.386b81 60 rts RTS -.386b82 PARSER_RAD_FILE_INSTRUMENT_21 -.386b82 PR_LOOP -.386b82 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386b84 c8 iny INY -.386b85 c9 00 cmp #$00 CMP #0 -.386b87 d0 f9 bne $386b82 BNE PR_LOOP -.386b89 a9 38 lda #$38 LDA #<`INSTRUMENT_ACCORDN -.386b8b 85 f2 sta $f2 STA RAD_ADDR + 2 -.386b8d ProcessNextInstruments_21 -.386b8d e2 20 sep #$20 SEP #$20 ; set A short -.386b8f b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Instrument Number -.386b91 f0 00 beq $386b93 BEQ DoneProcessingInstrument_21 -.386b93 DoneProcessingInstrument_21 -.386b93 c8 iny INY -.386b94 60 rts RTS -.386b95 PROCESS_ORDER_LIST_10 -.386b95 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Song Length -.386b97 8f 68 6a 38 sta $386a68 STA @lTuneInfo.songLength -.386b9b aa tax TAX -.386b9c c8 iny INY -.386b9d c2 20 rep #$20 REP #$20 ; set A long -.386b9f a9 24 fc lda #$fc24 LDA #<>ORDERS -.386ba2 85 f0 sta $f0 STA RAD_ADDR -.386ba4 a9 39 00 lda #$0039 LDA #<`ORDERS -.386ba7 85 f2 sta $f2 STA RAD_ADDR + 2 -.386ba9 e2 20 sep #$20 SEP #$20 ; set A short -.386bab READ_ORDER -.386bab b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386bad c8 iny INY -.386bae 87 f0 sta [$f0] STA [RAD_ADDR] -.386bb0 e6 f0 inc $f0 INC RAD_ADDR -.386bb2 b0 02 bcs $386bb6 BCS ORDER_CONTINUE -.386bb4 e6 f1 inc $f1 INC RAD_ADDR + 1 -.386bb6 ORDER_CONTINUE -.386bb6 ca dex DEX -.386bb7 d0 f2 bne $386bab BNE READ_ORDER -.386bb9 60 rts RTS -.386bba READ_PATTERNS_10 -.386bba 64 f3 stz $f3 STZ RAD_PATTRN -.386bbc a9 39 lda #$39 LDA #<`PATTERNS -.386bbe 85 f6 sta $f6 STA RAD_PTN_DEST + 2 -.386bc0 NEXT_PATTERN -.386bc0 c2 20 rep #$20 REP #$20 ; set A long -.386bc2 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386bc4 f0 1f beq $386be5 BEQ SKIP_PATTERN -.386bc6 5a phy PHY -.386bc7 a8 tay TAY -.386bc8 a5 f3 lda $f3 LDA RAD_PATTRN -.386bca 29 ff 00 and #$00ff AND #$00FF -.386bcd 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.386bd1 a9 01 07 lda #$0701 LDA #PATTERN_BYTES -.386bd4 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.386bd8 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.386bdc 1a inc a INC A ; skip the pattern byte -.386bdd 85 f4 sta $f4 STA RAD_PTN_DEST -.386bdf e2 20 sep #$20 SEP #$20 ; set A short -.386be1 20 f2 6b jsr $386bf2 JSR READ_PATTERN_10 -.386be4 7a ply PLY -.386be5 SKIP_PATTERN -.386be5 c8 iny INY -.386be6 c8 iny INY -.386be7 e2 20 sep #$20 SEP #$20 ; set A short -.386be9 e6 f3 inc $f3 INC RAD_PATTRN -.386beb a5 f3 lda $f3 LDA RAD_PATTRN -.386bed c9 20 cmp #$20 CMP #32 -.386bef d0 cf bne $386bc0 BNE NEXT_PATTERN -.386bf1 60 rts RTS -.386bf2 READ_PATTERN_10 -.386bf2 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; read the line number - bit 7 indicates the last line -.386bf4 8f 42 00 00 sta $000042 STA @lRAD_LINE -.386bf8 c8 iny INY -.386bf9 c2 20 rep #$20 REP #$20 ; set A long -.386bfb 29 7f 00 and #$007f AND #$7F -.386bfe 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.386c02 a9 1c 00 lda #$001c LDA #LINE_BYTES -.386c05 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.386c09 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.386c0d 1a inc a INC A ; skip the line number -.386c0e 8f fa 00 00 sta $0000fa STA @lRAD_LINE_PTR -.386c12 e2 20 sep #$20 SEP #$20 ; set A short -.386c14 READ_NOTE -.386c14 a6 fa ldx $fa LDX RAD_LINE_PTR ; X contains the offset in the destination memory -.386c16 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; channel - bit 7 indicates the last note +.386b20 89 40 bit #$40 BIT #$40 +.386b22 f0 17 beq $386b3b BEQ RT_NOT_SLOW +.386b24 a9 01 lda #$01 LDA #1 +.386b26 8f d5 6a 38 sta $386ad5 STA @lTuneInfo.hasSlowTimer +.386b2a a9 0f lda #$0f LDA #SLOW_TIMER +.386b31 8d 66 01 sta $0166 STA TIMER0_CMP_M +.386b34 a9 0c lda #$0c LDA #<`SLOW_TIMER +.386b36 8d 67 01 sta $0167 STA TIMER0_CMP_H +.386b39 80 23 bra $386b5e BRA SET_TIMER +.386b3b RT_NOT_SLOW +.386b3b 89 20 bit #$20 BIT #$20 +.386b3d f0 0a beq $386b49 BEQ RT_NOT_BPM +.386b3f c8 iny INY +.386b40 c2 20 rep #$20 REP #$20 ; set A long +.386b42 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386b44 e2 20 sep #$20 SEP #$20 ; set A short +.386b46 c8 iny INY +.386b47 80 15 bra $386b5e BRA SET_TIMER +.386b49 RT_NOT_BPM +.386b49 a9 00 lda #$00 LDA #0 +.386b4b 8f d5 6a 38 sta $386ad5 STA @lTuneInfo.hasSlowTimer +.386b4f a9 98 lda #$98 LDA #FIFTY_HZ_COUNT +.386b56 8d 66 01 sta $0166 STA TIMER0_CMP_M +.386b59 a9 04 lda #$04 LDA #<`FIFTY_HZ_COUNT +.386b5b 8d 67 01 sta $0167 STA TIMER0_CMP_H +.386b5e SET_TIMER +.386b5e 20 7a 65 jsr $38657a JSR INIT_TIMER0 +.386b61 60 rts RTS +.386b62 READ_VERSION_10 +.386b62 a9 01 lda #$01 LDA #1 +.386b64 8f d2 6a 38 sta $386ad2 STA @lTuneInfo.version +.386b68 20 80 6b jsr $386b80 JSR PARSER_RAD_FILE_INSTRUMENT_10; Parse the Instrument +.386b6b 20 00 6c jsr $386c00 JSR PROCESS_ORDER_LIST_10 ; Parse the Order List +.386b6e 20 25 6c jsr $386c25 JSR READ_PATTERNS_10 +.386b71 20 1b 6b jsr $386b1b JSR READ_TIMER +.386b74 6b rtl RTL ; End of READ_VERSION_10 +>386b75 07 01 08 02 09 03 0a 04 ADLIB_OFFSETS .byte 7,1,8,2,9,3,10,4,5,11,6 +>386b7d 05 0b 06 +.386b80 PARSER_RAD_FILE_INSTRUMENT_10 +.386b80 c8 iny INY ; $11 bit 7: description, bit6: slow timer, bits4..0: speed +.386b81 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386b83 29 1f and #$1f AND #$1F +.386b85 8f d4 6a 38 sta $386ad4 STA @lTuneInfo.InitialSpeed +.386b89 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386b8b 29 80 and #$80 AND #$80 +.386b8d f0 07 beq $386b96 BEQ READ_INSTR_DATA +.386b8f Not_Done_With_Description +.386b8f c8 iny INY ; Move the Pointer Forward +.386b90 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386b92 c9 00 cmp #$00 CMP #$00 ; Check for the End of Text +.386b94 d0 f9 bne $386b8f BNE Not_Done_With_Description +.386b96 READ_INSTR_DATA +.386b96 c8 iny INY ; This points after either After Description or next to Offset 0x11 +.386b97 a9 38 lda #$38 LDA #<`INSTRUMENT_ACCORDN +.386b99 85 f2 sta $f2 STA RAD_ADDR + 2 +.386b9b ProcessNextInstruments_10 +.386b9b e2 20 sep #$20 SEP #$20 ; set A short +.386b9d b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Instrument Number +.386b9f f0 4a beq $386beb BEQ DoneProcessingInstrument_10 +.386ba1 c2 20 rep #$20 REP #$20 ; set A long +.386ba3 3a dec a DEC A +.386ba4 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.386ba8 a9 16 00 lda #$0016 LDA #INSTR_REC_LEN +.386bab 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.386baf af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT ; not sure why this one requires a long address - bank is still 0 +.386bb3 18 clc CLC +.386bb4 69 3b 10 adc #$103b ADC #<>INSTRUMENT_ACCORDN +.386bb7 85 f0 sta $f0 STA RAD_ADDR +.386bb9 a9 00 00 lda #$0000 LDA #0 +.386bbc e2 20 sep #$20 SEP #$20 ; set A short +.386bbe c8 iny INY +.386bbf 64 4e stz $4e STZ RAD_TEMP +.386bc1 87 f0 sta [$f0] STA [RAD_ADDR] ; Not a drum instrument +.386bc3 Transfer_Instrument_Info +.386bc3 a6 4e ldx $4e LDX RAD_TEMP +.386bc5 bf 75 6b 38 lda $386b75,x LDA ADLIB_OFFSETS,X ; RAD uses a different order for registers +.386bc9 aa tax TAX +.386bca b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Register +.386bcc 5a phy PHY +.386bcd 9b txy TXY +.386bce 97 f0 sta [$f0],y STA [RAD_ADDR],Y ; Write to the instrument table +.386bd0 7a ply PLY +.386bd1 c8 iny INY +.386bd2 e6 4e inc $4e INC RAD_TEMP +.386bd4 a5 4e lda $4e LDA RAD_TEMP +.386bd6 c9 0b cmp #$0b CMP #11 +.386bd8 90 e9 bcc $386bc3 BCC Transfer_Instrument_Info +.386bda 5a phy PHY ; store the position in the file on the stack +.386bdb a0 0c 00 ldy #$000c LDY #12 ; beginning of text +.386bde a9 20 lda #$20 LDA #$20 +.386be0 BLANK_INSTR_DESCR +.386be0 97 f0 sta [$f0],y STA [RAD_ADDR],Y +.386be2 c8 iny INY +.386be3 c0 16 00 cpy #$0016 CPY #22 +.386be6 d0 f8 bne $386be0 BNE BLANK_INSTR_DESCR +.386be8 7a ply PLY +.386be9 80 b0 bra $386b9b BRA ProcessNextInstruments_10 +.386beb DoneProcessingInstrument_10 +.386beb c8 iny INY +.386bec 60 rts RTS +.386bed PARSER_RAD_FILE_INSTRUMENT_21 +.386bed PR_LOOP +.386bed b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386bef c8 iny INY +.386bf0 c9 00 cmp #$00 CMP #0 +.386bf2 d0 f9 bne $386bed BNE PR_LOOP +.386bf4 a9 38 lda #$38 LDA #<`INSTRUMENT_ACCORDN +.386bf6 85 f2 sta $f2 STA RAD_ADDR + 2 +.386bf8 ProcessNextInstruments_21 +.386bf8 e2 20 sep #$20 SEP #$20 ; set A short +.386bfa b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Instrument Number +.386bfc f0 00 beq $386bfe BEQ DoneProcessingInstrument_21 +.386bfe DoneProcessingInstrument_21 +.386bfe c8 iny INY +.386bff 60 rts RTS +.386c00 PROCESS_ORDER_LIST_10 +.386c00 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; Read Song Length +.386c02 8f d3 6a 38 sta $386ad3 STA @lTuneInfo.songLength +.386c06 aa tax TAX +.386c07 c8 iny INY +.386c08 c2 20 rep #$20 REP #$20 ; set A long +.386c0a a9 24 fc lda #$fc24 LDA #<>ORDERS +.386c0d 85 f0 sta $f0 STA RAD_ADDR +.386c0f a9 39 00 lda #$0039 LDA #<`ORDERS +.386c12 85 f2 sta $f2 STA RAD_ADDR + 2 +.386c14 e2 20 sep #$20 SEP #$20 ; set A short +.386c16 READ_ORDER +.386c16 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y .386c18 c8 iny INY -.386c19 8f f9 00 00 sta $0000f9 STA @lRAD_LAST_NOTE -.386c1d 29 0f and #$0f AND #$F -.386c1f 8f f7 00 00 sta $0000f7 STA @lRAD_CHANNEL -.386c23 c2 20 rep #$20 REP #$20 ; set A long -.386c25 8a txa TXA -.386c26 18 clc CLC -.386c27 65 f7 adc $f7 ADC RAD_CHANNEL ; multiply channel by 3 -.386c29 65 f7 adc $f7 ADC RAD_CHANNEL -.386c2b 65 f7 adc $f7 ADC RAD_CHANNEL -.386c2d aa tax TAX -.386c2e e2 20 sep #$20 SEP #$20 ; set A short -.386c30 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; note / octave -.386c32 5a phy PHY -.386c33 9b txy TXY -.386c34 97 f4 sta [$f4],y STA [RAD_PTN_DEST],Y -.386c36 7a ply PLY -.386c37 c8 iny INY -.386c38 e8 inx INX -.386c39 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; instrument/effect -.386c3b 5a phy PHY -.386c3c 9b txy TXY -.386c3d 97 f4 sta [$f4],y STA [RAD_PTN_DEST],Y -.386c3f 7a ply PLY -.386c40 c8 iny INY -.386c41 e8 inx INX -.386c42 29 0f and #$0f AND #$F -.386c44 f0 09 beq $386c4f BEQ CHECK_LASTNOTE -.386c46 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; effect parameter -.386c48 5a phy PHY -.386c49 9b txy TXY -.386c4a 97 f4 sta [$f4],y STA [RAD_PTN_DEST],Y -.386c4c 7a ply PLY -.386c4d c8 iny INY -.386c4e e8 inx INX -.386c4f CHECK_LASTNOTE -.386c4f af f9 00 00 lda $0000f9 LDA @lRAD_LAST_NOTE -.386c53 10 bf bpl $386c14 BPL READ_NOTE -.386c55 af 42 00 00 lda $000042 LDA @lRAD_LINE -.386c59 10 97 bpl $386bf2 BPL READ_PATTERN_10 -.386c5b 60 rts RTS -.386c5c DRAW_BLANKS -.386c5c 5a phy PHY -.386c5d da phx PHX -.386c5e a2 12 00 ldx #$0012 LDX #18 -.386c61 a0 00 00 ldy #$0000 LDY #0 -.386c64 a9 2d lda #$2d LDA #'-' -.386c66 BL_NEXT -.386c66 97 0c sta [$0c],y STA [SCREENBEGIN], Y -.386c68 c8 iny INY -.386c69 ca dex DEX -.386c6a d0 fa bne $386c66 BNE BL_NEXT -.386c6c fa plx PLX -.386c6d 7a ply PLY -.386c6e 60 rts RTS -.386c6f DISPLAY_RAD_PTN_DEST -.386c6f 5a phy PHY -.386c70 a5 f6 lda $f6 LDA RAD_PTN_DEST+2 -.386c72 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386c75 c8 iny INY -.386c76 c8 iny INY -.386c77 a5 f5 lda $f5 LDA RAD_PTN_DEST+1 -.386c79 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386c7c c8 iny INY -.386c7d c8 iny INY -.386c7e a5 f4 lda $f4 LDA RAD_PTN_DEST -.386c80 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386c83 7a ply PLY -.386c84 60 rts RTS -.386c85 WRITE_A_LNG -.386c85 48 pha PHA -.386c86 48 pha PHA -.386c87 e2 20 sep #$20 SEP #$20 ; set A short -.386c89 68 pla PLA -.386c8a 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386c8d 88 dey DEY -.386c8e 88 dey DEY -.386c8f 68 pla PLA -.386c90 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386c93 c2 20 rep #$20 REP #$20 ; set A long -.386c95 68 pla PLA -.386c96 60 rts RTS -.386c97 RAD_ALL_NOTES_OFF -.386c97 5a phy PHY -.386c98 c2 20 rep #$20 REP #$20 ; set A long -.386c9a a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE -.386c9d 85 2c sta $2c STA OPL2_IND_ADDY_LL -.386c9f a9 af 00 lda #$00af LDA #`OPL3_R_BASE -.386ca2 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 -.386ca4 e2 20 sep #$20 SEP #$20 ; set A short -.386ca6 a0 a0 00 ldy #$00a0 LDY #$A0 -.386ca9 a9 00 lda #$00 LDA #0 -.386cab NEXT_NOTE_OFF -.386cab 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386cad c8 iny INY -.386cae c0 b9 00 cpy #$00b9 CPY #$B9 -.386cb1 d0 f8 bne $386cab BNE NEXT_NOTE_OFF -.386cb3 7a ply PLY -.386cb4 60 rts RTS -.386cb5 RAD_PLAYNOTES -.386cb5 5a phy PHY -.386cb6 20 5c 6c jsr $386c5c JSR DRAW_BLANKS -.386cb9 c2 20 rep #$20 REP #$20 ; set A long -.386cbb af 18 0f 38 lda $380f18 LDA PATTERN_NUM -.386cbf 29 ff 00 and #$00ff AND #$FF -.386cc2 3a dec a DEC A ; start at 0 -.386cc3 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.386cc7 a9 01 07 lda #$0701 LDA #PATTERN_BYTES -.386cca 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.386cce af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.386cd2 1a inc a INC A ; skip the pattern number byte -.386cd3 85 f4 sta $f4 STA RAD_PTN_DEST -.386cd5 e2 20 sep #$20 SEP #$20 ; set A short -.386cd7 a9 39 lda #$39 LDA #<`PATTERNS -.386cd9 85 f6 sta $f6 STA RAD_PTN_DEST + 2 -.386cdb a0 a0 00 ldy #$00a0 LDY #SCREEN_WIDTH * 2 -.386cde 20 6f 6c jsr $386c6f JSR DISPLAY_RAD_PTN_DEST ; display the address of the pattern -.386ce1 c2 20 rep #$20 REP #$20 ; set A long -.386ce3 a5 6c lda $6c LDA LINE_NUM_HEX -.386ce5 29 7f 00 and #$007f AND #$7F -.386ce8 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A -.386cec a9 1c 00 lda #$001c LDA #LINE_BYTES -.386cef 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B -.386cf3 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT -.386cf7 1a inc a INC A ; skip the line number byte -.386cf8 a0 52 00 ldy #$0052 LDY #SCREEN_WIDTH + 2 -.386cfb 20 85 6c jsr $386c85 JSR WRITE_A_LNG ; display the line offset from the pattern address -.386cfe a8 tay TAY ; Y contains the line offset -.386cff a9 00 00 lda #$0000 LDA #0 -.386d02 e2 20 sep #$20 SEP #$20 ; set A short -.386d04 64 28 stz $28 STZ OPL2_REG_REGION -.386d06 PN_NEXT_NOTE -.386d06 8f 27 00 00 sta $000027 STA @lOPL2_CHANNEL -.386d0a aa tax TAX -.386d0b bf b2 68 38 lda $3868b2,x LDA CHANNELS,X -.386d0f d0 05 bne $386d16 BNE PN_PLAY_NOTE -.386d11 c8 iny INY ; skip the channel data -.386d12 c8 iny INY -.386d13 c8 iny INY -.386d14 80 58 bra $386d6e BRA PN_CONTINUE -.386d16 PN_PLAY_NOTE -.386d16 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; octave/note -.386d18 29 7f and #$7f AND #$7F -.386d1a 20 d5 6e jsr $386ed5 JSR RAD_WRITE_OCT_NOTE -.386d1d b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; bit 7 is bit 4 of the instrument number -.386d1f 29 80 and #$80 AND #$80 -.386d21 4a lsr a LSR A -.386d22 4a lsr a LSR A -.386d23 4a lsr a LSR A -.386d24 85 4e sta $4e STA RAD_TEMP -.386d26 c8 iny INY -.386d27 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; instrument/effect -.386d29 29 f0 and #$f0 AND #$F0 -.386d2b 4a lsr a LSR A -.386d2c 4a lsr a LSR A -.386d2d 4a lsr a LSR A -.386d2e 4a lsr a LSR A -.386d2f 65 4e adc $4e ADC RAD_TEMP -.386d31 f0 14 beq $386d47 BEQ SKIP_INSTRUMENT -.386d33 3a dec a DEC A ; instruments are starting at 0 -.386d34 8f 6a 00 00 sta $00006a STA @lINSTR_NUMBER -.386d38 5a phy PHY -.386d39 a6 27 ldx $27 LDX OPL2_CHANNEL -.386d3b a9 00 lda #$00 LDA #0 -.386d3d eb xba XBA -.386d3e bf 18 10 38 lda $381018,x LDA @lregisterOffsets_operator0,X -.386d42 aa tax TAX -.386d43 20 4e 65 jsr $38654e JSR LOAD_INSTRUMENT -.386d46 7a ply PLY -.386d47 SKIP_INSTRUMENT -.386d47 af 30 00 00 lda $000030 LDA @lOPL2_NOTE -.386d4b f0 11 beq $386d5e BEQ SKIP_NOTE ; if the note is 0, don't play anything. -.386d4d c9 0f cmp #$0f CMP #$0F ; NOTE OFF -.386d4f f0 2b beq $386d7c BEQ RAD_NOTE_OFF -.386d51 c2 20 rep #$20 REP #$20 ; set A long -.386d53 5a phy PHY -.386d54 20 f5 37 jsr $3837f5 JSR OPL2_GET_REG_OFFSET -.386d57 22 01 32 38 jsl $383201 JSL OPL2_PLAYNOTE -.386d5b 7a ply PLY -.386d5c e2 20 sep #$20 SEP #$20 ; set A short -.386d5e SKIP_NOTE -.386d5e a9 00 lda #$00 LDA #0 -.386d60 eb xba XBA -.386d61 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; instrument/effect -.386d63 c8 iny INY -.386d64 29 0f and #$0f AND #$F -.386d66 f0 05 beq $386d6d BEQ SKIP_EFFECT -.386d68 0a asl a ASL A ; double bytes -.386d69 aa tax TAX -.386d6a fc 8d 6d jsr ($386d8d,x) JSR (RAD_EFFECT_TABLE,X) -.386d6d SKIP_EFFECT -.386d6d c8 iny INY -.386d6e PN_CONTINUE -.386d6e a9 00 lda #$00 LDA #0 ; clear B -.386d70 eb xba XBA -.386d71 af 27 00 00 lda $000027 LDA @lOPL2_CHANNEL -.386d75 1a inc a INC A -.386d76 c9 09 cmp #$09 CMP #9 -.386d78 d0 8c bne $386d06 BNE PN_NEXT_NOTE -.386d7a 7a ply PLY -.386d7b 60 rts RTS -.386d7c RAD_NOTE_OFF -.386d7c af 27 00 00 lda $000027 LDA @lOPL2_CHANNEL -.386d80 18 clc CLC -.386d81 69 b0 adc #$b0 ADC #$B0 -.386d83 85 2c sta $2c STA OPL2_IND_ADDY_LL -.386d85 a9 00 lda #$00 LDA #0 -.386d87 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386d89 c8 iny INY -.386d8a c8 iny INY -.386d8b 80 e1 bra $386d6e BRA PN_CONTINUE -.386d8d RAD_EFFECT_TABLE ->386d8d ad 6d .word <>RAD_EFFECT_NONE ; 00 ->386d8f 20 6e .word <>RAD_EFFECT_NOTE_SLIDE_UP ; 01 ->386d91 20 6e .word <>RAD_EFFECT_NOTE_SLIDE_DOWN ; 02 ->386d93 ad 6d .word <>RAD_EFFECT_NOTE_SLIDE_TO ; 03 ->386d95 ad 6d .word <>RAD_NOOP ->386d97 ad 6d .word <>RAD_EFFECT_NOTE_SLIDE_VOLUME ; 05 ->386d99 ad 6d .word <>RAD_NOOP ->386d9b ad 6d .word <>RAD_NOOP ->386d9d ad 6d .word <>RAD_NOOP ->386d9f ad 6d .word <>RAD_NOOP ->386da1 ae 6d .word <>RAD_EFFECT_VOLUME_SLIDE ; 0A ->386da3 ad 6d .word <>RAD_NOOP ->386da5 96 6e .word <>RAD_EFFECT_SET_VOLUME ; 0C ->386da7 05 6e .word <>RAD_EFFECT_PATTERN_BREAK ; 0D ->386da9 ad 6d .word <>RAD_NOOP ->386dab 16 6e .word <>RAD_EFFECT_SET_SPEED ; 0F -.386dad RAD_NOOP -.386dad RAD_EFFECT_NONE -.386dad RAD_EFFECT_NOTE_SLIDE_TO -.386dad RAD_EFFECT_NOTE_SLIDE_VOLUME -.386dad 60 rts RTS -.386dae RAD_EFFECT_VOLUME_SLIDE -.386dae 5a phy PHY -.386daf b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; store value of the effect in RAD_CHANNE_EFFCT -.386db1 85 4c sta $4c STA RAD_CHANNE_EFFCT -.386db3 c2 20 rep #$20 REP #$20 ; set A long -.386db5 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE -.386db8 85 2c sta $2c STA OPL2_IND_ADDY_LL -.386dba a9 af 00 lda #$00af LDA #`OPL3_R_BASE -.386dbd 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 -.386dbf e2 30 sep #$30 SEP #$30 ; set A&X short -.386dc1 a5 27 lda $27 LDA OPL2_CHANNEL -.386dc3 aa tax TAX -.386dc4 bf 18 10 38 lda $381018,x LDA @lregisterOffsets_operator0,X -.386dc8 18 clc CLC -.386dc9 69 40 adc #$40 ADC #$40 -.386dcb a8 tay TAY -.386dcc b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; volume -.386dce 48 pha PHA -.386dcf 29 3f and #$3f AND #$3F -.386dd1 18 clc CLC -.386dd2 65 4c adc $4c ADC RAD_CHANNE_EFFCT ; check for values greater than 50 -.386dd4 c9 40 cmp #$40 CMP #$40 ; if there's an overflow, use #$3F (low volume) -.386dd6 90 02 bcc $386dda BCC NO_OVERFLOW_0 -.386dd8 a9 3f lda #$3f LDA #$3F -.386dda NO_OVERFLOW_0 -.386dda 29 3f and #$3f AND #$3F -.386ddc 85 4e sta $4e STA RAD_TEMP -.386dde 68 pla PLA -.386ddf 29 c0 and #$c0 AND #$C0 -.386de1 05 4e ora $4e ORA RAD_TEMP -.386de3 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386de5 c8 iny INY -.386de6 c8 iny INY -.386de7 c8 iny INY -.386de8 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; volume -.386dea 48 pha PHA -.386deb 29 3f and #$3f AND #$3F -.386ded 18 clc CLC -.386dee 65 4c adc $4c ADC RAD_CHANNE_EFFCT -.386df0 c9 40 cmp #$40 CMP #$40 ; if there's an overflow, use #$3F (low volume) -.386df2 90 02 bcc $386df6 BCC NO_OVERFLOW_1 -.386df4 a9 3f lda #$3f LDA #$3F -.386df6 NO_OVERFLOW_1 -.386df6 29 3f and #$3f AND #$3F -.386df8 85 4e sta $4e STA RAD_TEMP -.386dfa 68 pla PLA -.386dfb 29 c0 and #$c0 AND #$C0 -.386dfd 05 4e ora $4e ORA RAD_TEMP -.386dff 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386e01 c2 10 rep #$10 REP #$10 ; set X long -.386e03 7a ply PLY -.386e04 60 rts RTS -.386e05 RAD_EFFECT_PATTERN_BREAK -.386e05 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; effect parameter -.386e07 3a dec a DEC A ; DECREMENT by 1, because the next timer interrupt will increment at the beginning -.386e08 85 6c sta $6c STA LINE_NUM_HEX -.386e0a a9 00 lda #$00 LDA #0 ; convert the effect to a decimal line number -.386e0c 8f 19 0f 38 sta $380f19 STA @lLINE_NUM_DEC -.386e10 20 9a 64 jsr $38649a JSR INCREMENT_ORDER -.386e13 7a ply PLY ; don't return to the calling method, return to the parent -.386e14 7a ply PLY -.386e15 60 rts RTS -.386e16 RAD_EFFECT_SET_SPEED -.386e16 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; effect parameter -.386e18 8f 69 6a 38 sta $386a69 STA @lTuneInfo.InitialSpeed -.386e1c 20 af 5a jsr $385aaf JSR DISPLAY_SPEED -.386e1f 60 rts RTS -.386e20 RAD_EFFECT_NOTE_SLIDE_UP -.386e20 RAD_EFFECT_NOTE_SLIDE_DOWN -.386e20 5a phy PHY -.386e21 4a lsr a LSR -.386e22 85 50 sta $50 STA RAD_EFFECT ; 1 slide down, 2 slide up -.386e24 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; store value of the effect in RAD_CHANNE_EFFCT -.386e26 85 4c sta $4c STA RAD_CHANNE_EFFCT -.386e28 c2 20 rep #$20 REP #$20 ; set A long -.386e2a a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE -.386e2d 85 2c sta $2c STA OPL2_IND_ADDY_LL -.386e2f a9 af 00 lda #$00af LDA #`OPL3_R_BASE -.386e32 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 -.386e34 e2 30 sep #$30 SEP #$30 ; set A&X short -.386e36 a5 27 lda $27 LDA OPL2_CHANNEL -.386e38 18 clc CLC -.386e39 69 a0 adc #$a0 ADC #$A0 -.386e3b a8 tay TAY -.386e3c b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; read low fnumber byte -.386e3e c2 10 rep #$10 REP #$10 ; set X long -.386e40 bb tyx TYX -.386e41 a0 5a 00 ldy #$005a LDY #SCREEN_WIDTH + 10 -.386e44 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386e47 9b txy TXY -.386e48 e2 10 sep #$10 SEP #$10 ; set X short -.386e4a 48 pha PHA ; store A on the stack -.386e4b 98 tya TYA -.386e4c 18 clc CLC -.386e4d 69 10 adc #$10 ADC #$10 -.386e4f a8 tay TAY -.386e50 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; read bits 0,1 of high fnumber -.386e52 85 4e sta $4e STA RAD_TEMP ; store the entire value of $B0 -.386e54 c2 10 rep #$10 REP #$10 ; set X long -.386e56 bb tyx TYX -.386e57 a0 a8 00 ldy #$00a8 LDY #SCREEN_WIDTH * 2 + 8 -.386e5a 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386e5d 29 03 and #$03 AND #3 -.386e5f a0 58 00 ldy #$0058 LDY #SCREEN_WIDTH + 8 -.386e62 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386e65 9b txy TXY -.386e66 eb xba XBA -.386e67 68 pla PLA ; A is now the FNUMBER -.386e68 aa tax TAX ; X is now the FNUMBER -.386e69 a5 50 lda $50 LDA RAD_EFFECT -.386e6b 89 02 bit #$02 BIT #2 -.386e6d f0 0a beq $386e79 BEQ SLIDE_UP -.386e6f c2 20 rep #$20 REP #$20 ; set A long -.386e71 8a txa TXA -.386e72 38 sec SEC -.386e73 e5 4c sbc $4c SBC RAD_CHANNE_EFFCT ; substract the effect parameter -.386e75 e2 20 sep #$20 SEP #$20 ; set A short -.386e77 80 08 bra $386e81 BRA FINISH_SLIDE -.386e79 SLIDE_UP -.386e79 c2 20 rep #$20 REP #$20 ; set A long -.386e7b 8a txa TXA -.386e7c 18 clc CLC -.386e7d 65 4c adc $4c ADC RAD_CHANNE_EFFCT ; substract the effect parameter -.386e7f e2 20 sep #$20 SEP #$20 ; set A short -.386e81 FINISH_SLIDE -.386e81 e2 10 sep #$10 SEP #$10 ; set X short -.386e83 eb xba XBA -.386e84 29 03 and #$03 AND #3 -.386e86 05 4e ora $4e ORA RAD_TEMP -.386e88 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386e8a 98 tya TYA -.386e8b 38 sec SEC -.386e8c e9 10 sbc #$10 SBC #$10 -.386e8e a8 tay TAY -.386e8f eb xba XBA -.386e90 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386e92 c2 10 rep #$10 REP #$10 ; set X long -.386e94 7a ply PLY -.386e95 60 rts RTS -.386e96 RAD_EFFECT_SET_VOLUME -.386e96 5a phy PHY -.386e97 c2 20 rep #$20 REP #$20 ; set A long -.386e99 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE -.386e9c 85 2c sta $2c STA OPL2_IND_ADDY_LL -.386e9e a9 af 00 lda #$00af LDA #`OPL3_R_BASE -.386ea1 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 -.386ea3 e2 20 sep #$20 SEP #$20 ; set A short -.386ea5 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; effect parameter -.386ea7 29 7f and #$7f AND #$7F -.386ea9 f0 01 beq $386eac BEQ HANDLE_ZERO -.386eab 3a dec a DEC A -.386eac HANDLE_ZERO -.386eac 49 3f eor #$3f EOR #$3F ; complement -.386eae 85 4e sta $4e STA RAD_TEMP -.386eb0 e2 10 sep #$10 SEP #$10 ; set X short -.386eb2 a6 27 ldx $27 LDX OPL2_CHANNEL -.386eb4 bf 18 10 38 lda $381018,x LDA @lregisterOffsets_operator0,X -.386eb8 18 clc CLC -.386eb9 69 40 adc #$40 ADC #$40 -.386ebb a8 tay TAY -.386ebc b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y -.386ebe 29 c0 and #$c0 AND #$C0 ; -.386ec0 18 clc CLC -.386ec1 65 4e adc $4e ADC RAD_TEMP -.386ec3 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386ec5 c8 iny INY -.386ec6 c8 iny INY -.386ec7 c8 iny INY -.386ec8 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y -.386eca 29 c0 and #$c0 AND #$C0 ; -.386ecc 18 clc CLC -.386ecd 65 4e adc $4e ADC RAD_TEMP -.386ecf 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y -.386ed1 c2 10 rep #$10 REP #$10 ; set X long -.386ed3 7a ply PLY -.386ed4 60 rts RTS -.386ed5 RAD_WRITE_OCT_NOTE -.386ed5 5a phy PHY -.386ed6 48 pha PHA -.386ed7 48 pha PHA -.386ed8 af 27 00 00 lda $000027 LDA @lOPL2_CHANNEL -.386edc 0a asl a ASL A ; multiply the channel by 2 for the screen position -.386edd a8 tay TAY -.386ede 68 pla PLA -.386edf f0 03 beq $386ee4 BEQ DONT_DISPLAY_00 -.386ee1 20 b1 57 jsr $3857b1 JSR WRITE_HEX -.386ee4 DONT_DISPLAY_00 -.386ee4 29 70 and #$70 AND #$70 ; octave -.386ee6 4a lsr a LSR -.386ee7 4a lsr a LSR -.386ee8 4a lsr a LSR -.386ee9 4a lsr a LSR -.386eea 8f 31 00 00 sta $000031 STA @lOPL2_OCTAVE -.386eee 68 pla PLA -.386eef 29 0f and #$0f AND #$0F ; note -.386ef1 8f 30 00 00 sta $000030 STA @lOPL2_NOTE -.386ef5 7a ply PLY -.386ef6 60 rts RTS -.386ef7 RAD_SETINSTRUMENT -.386ef7 5a phy PHY -.386ef8 e2 20 sep #$20 SEP #$20 ; set A short -.386efa a9 01 lda #$01 LDA #$01 -.386efc 85 26 sta $26 STA OPL2_OPERATOR -.386efe c2 20 rep #$20 REP #$20 ; set A long -.386f00 a9 38 00 lda #$0038 LDA #<`INSTRUMENT_ACCORDN -.386f03 85 0a sta $0a STA OPL2_ADDY_PTR_HI -.386f05 a5 32 lda $32 LDA OPL2_PARAMETER0 -.386f07 29 ff 00 and #$00ff AND #$00FF -.386f0a 3a dec a DEC A -.386f0b 0a asl a ASL A -.386f0c 0a asl a ASL A -.386f0d 0a asl a ASL A -.386f0e 0a asl a ASL A -.386f0f 18 clc CLC -.386f10 69 3b 10 adc #$103b ADC #<>INSTRUMENT_ACCORDN -.386f13 85 08 sta $08 STA OPL2_ADDY_PTR_LO -.386f15 c2 20 rep #$20 REP #$20 ; set A long -.386f17 a9 20 00 lda #$0020 LDA #$0020 -.386f1a 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f1e e2 20 sep #$20 SEP #$20 ; set A short -.386f20 a0 00 00 ldy #$0000 LDY #$0000 -.386f23 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f25 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f27 c2 20 rep #$20 REP #$20 ; set A long -.386f29 a9 40 00 lda #$0040 LDA #$0040 -.386f2c 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f30 e2 20 sep #$20 SEP #$20 ; set A short -.386f32 a0 02 00 ldy #$0002 LDY #$0002 -.386f35 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f37 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f39 c2 20 rep #$20 REP #$20 ; set A long -.386f3b a9 60 00 lda #$0060 LDA #$0060 -.386f3e 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f42 e2 20 sep #$20 SEP #$20 ; set A short -.386f44 a0 04 00 ldy #$0004 LDY #$0004 -.386f47 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f49 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f4b c2 20 rep #$20 REP #$20 ; set A long -.386f4d a9 80 00 lda #$0080 LDA #$0080 -.386f50 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f54 e2 20 sep #$20 SEP #$20 ; set A short -.386f56 a0 06 00 ldy #$0006 LDY #$0006 -.386f59 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f5b 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f5d c2 20 rep #$20 REP #$20 ; set A long -.386f5f a9 e0 00 lda #$00e0 LDA #$00E0 -.386f62 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f66 e2 20 sep #$20 SEP #$20 ; set A short -.386f68 a0 09 00 ldy #$0009 LDY #$0009 -.386f6b b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f6d 29 0f and #$0f AND #$0F -.386f6f 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f71 a9 00 lda #$00 LDA #$00 -.386f73 85 26 sta $26 STA OPL2_OPERATOR -.386f75 c2 20 rep #$20 REP #$20 ; set A long -.386f77 a9 20 00 lda #$0020 LDA #$0020 -.386f7a 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f7e e2 20 sep #$20 SEP #$20 ; set A short -.386f80 a0 01 00 ldy #$0001 LDY #$0001 -.386f83 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f85 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f87 c2 20 rep #$20 REP #$20 ; set A long -.386f89 a9 40 00 lda #$0040 LDA #$0040 -.386f8c 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386f90 e2 20 sep #$20 SEP #$20 ; set A short -.386f92 a0 03 00 ldy #$0003 LDY #$0003 -.386f95 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386f97 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386f99 c2 20 rep #$20 REP #$20 ; set A long -.386f9b a9 60 00 lda #$0060 LDA #$0060 -.386f9e 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386fa2 e2 20 sep #$20 SEP #$20 ; set A short -.386fa4 a0 05 00 ldy #$0005 LDY #$0005 -.386fa7 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386fa9 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386fab c2 20 rep #$20 REP #$20 ; set A long -.386fad a9 80 00 lda #$0080 LDA #$0080 -.386fb0 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386fb4 e2 20 sep #$20 SEP #$20 ; set A short -.386fb6 a0 71 00 ldy #$0071 LDY #$00071 -.386fb9 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386fbb 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386fbd c2 20 rep #$20 REP #$20 ; set A long -.386fbf a9 e0 00 lda #$00e0 LDA #$00E0 -.386fc2 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET -.386fc6 e2 20 sep #$20 SEP #$20 ; set A short -.386fc8 a0 09 00 ldy #$0009 LDY #$0009 -.386fcb b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386fcd 29 f0 and #$f0 AND #$F0 -.386fcf 4a lsr a LSR A -.386fd0 4a lsr a LSR A -.386fd1 4a lsr a LSR A -.386fd2 4a lsr a LSR A -.386fd3 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386fd5 a5 27 lda $27 LDA OPL2_CHANNEL -.386fd7 18 clc CLC -.386fd8 29 0f and #$0f AND #$0F ; This is just precaution, it should be between 0 to 8 -.386fda 69 c0 adc #$c0 ADC #$C0 -.386fdc 85 2a sta $2a STA OPL2_REG_OFFSET -.386fde a9 00 lda #$00 LDA #$00 -.386fe0 85 2b sta $2b STA OPL2_REG_OFFSET+1; -.386fe2 c2 30 rep #$30 REP #$30 ; set A&X long -.386fe4 18 clc CLC -.386fe5 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE -.386fe8 65 2a adc $2a ADC OPL2_REG_OFFSET -.386fea 85 2c sta $2c STA OPL2_IND_ADDY_LL -.386fec a9 af 00 lda #$00af LDA #`OPL3_R_BASE -.386fef 85 2e sta $2e STA OPL2_IND_ADDY_HL -.386ff1 e2 20 sep #$20 SEP #$20 ; set A short -.386ff3 a0 08 00 ldy #$0008 LDY #$0008 -.386ff6 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y -.386ff8 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] -.386ffa 7a ply PLY -.386ffb 60 rts RTS +.386c19 87 f0 sta [$f0] STA [RAD_ADDR] +.386c1b e6 f0 inc $f0 INC RAD_ADDR +.386c1d b0 02 bcs $386c21 BCS ORDER_CONTINUE +.386c1f e6 f1 inc $f1 INC RAD_ADDR + 1 +.386c21 ORDER_CONTINUE +.386c21 ca dex DEX +.386c22 d0 f2 bne $386c16 BNE READ_ORDER +.386c24 60 rts RTS +.386c25 READ_PATTERNS_10 +.386c25 64 f3 stz $f3 STZ RAD_PATTRN +.386c27 a9 39 lda #$39 LDA #<`PATTERNS +.386c29 85 f6 sta $f6 STA RAD_PTN_DEST + 2 +.386c2b NEXT_PATTERN +.386c2b c2 20 rep #$20 REP #$20 ; set A long +.386c2d b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386c2f f0 1f beq $386c50 BEQ SKIP_PATTERN +.386c31 5a phy PHY +.386c32 a8 tay TAY +.386c33 a5 f3 lda $f3 LDA RAD_PATTRN +.386c35 29 ff 00 and #$00ff AND #$00FF +.386c38 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.386c3c a9 01 07 lda #$0701 LDA #PATTERN_BYTES +.386c3f 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.386c43 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.386c47 1a inc a INC A ; skip the pattern byte +.386c48 85 f4 sta $f4 STA RAD_PTN_DEST +.386c4a e2 20 sep #$20 SEP #$20 ; set A short +.386c4c 20 5d 6c jsr $386c5d JSR READ_PATTERN_10 +.386c4f 7a ply PLY +.386c50 SKIP_PATTERN +.386c50 c8 iny INY +.386c51 c8 iny INY +.386c52 e2 20 sep #$20 SEP #$20 ; set A short +.386c54 e6 f3 inc $f3 INC RAD_PATTRN +.386c56 a5 f3 lda $f3 LDA RAD_PATTRN +.386c58 c9 20 cmp #$20 CMP #32 +.386c5a d0 cf bne $386c2b BNE NEXT_PATTERN +.386c5c 60 rts RTS +.386c5d READ_PATTERN_10 +.386c5d b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; read the line number - bit 7 indicates the last line +.386c5f 8f 42 00 00 sta $000042 STA @lRAD_LINE +.386c63 c8 iny INY +.386c64 c2 20 rep #$20 REP #$20 ; set A long +.386c66 29 7f 00 and #$007f AND #$7F +.386c69 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.386c6d a9 1c 00 lda #$001c LDA #LINE_BYTES +.386c70 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.386c74 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.386c78 1a inc a INC A ; skip the line number +.386c79 8f fa 00 00 sta $0000fa STA @lRAD_LINE_PTR +.386c7d e2 20 sep #$20 SEP #$20 ; set A short +.386c7f READ_NOTE +.386c7f a6 fa ldx $fa LDX RAD_LINE_PTR ; X contains the offset in the destination memory +.386c81 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; channel - bit 7 indicates the last note +.386c83 c8 iny INY +.386c84 8f f9 00 00 sta $0000f9 STA @lRAD_LAST_NOTE +.386c88 29 0f and #$0f AND #$F +.386c8a 8f f7 00 00 sta $0000f7 STA @lRAD_CHANNEL +.386c8e c2 20 rep #$20 REP #$20 ; set A long +.386c90 8a txa TXA +.386c91 18 clc CLC +.386c92 65 f7 adc $f7 ADC RAD_CHANNEL ; multiply channel by 3 +.386c94 65 f7 adc $f7 ADC RAD_CHANNEL +.386c96 65 f7 adc $f7 ADC RAD_CHANNEL +.386c98 aa tax TAX +.386c99 e2 20 sep #$20 SEP #$20 ; set A short +.386c9b b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; note / octave +.386c9d 5a phy PHY +.386c9e 9b txy TXY +.386c9f 97 f4 sta [$f4],y STA [RAD_PTN_DEST],Y +.386ca1 7a ply PLY +.386ca2 c8 iny INY +.386ca3 e8 inx INX +.386ca4 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; instrument/effect +.386ca6 5a phy PHY +.386ca7 9b txy TXY +.386ca8 97 f4 sta [$f4],y STA [RAD_PTN_DEST],Y +.386caa 7a ply PLY +.386cab c8 iny INY +.386cac e8 inx INX +.386cad 29 0f and #$0f AND #$F +.386caf f0 09 beq $386cba BEQ CHECK_LASTNOTE +.386cb1 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y ; effect parameter +.386cb3 5a phy PHY +.386cb4 9b txy TXY +.386cb5 97 f4 sta [$f4],y STA [RAD_PTN_DEST],Y +.386cb7 7a ply PLY +.386cb8 c8 iny INY +.386cb9 e8 inx INX +.386cba CHECK_LASTNOTE +.386cba af f9 00 00 lda $0000f9 LDA @lRAD_LAST_NOTE +.386cbe 10 bf bpl $386c7f BPL READ_NOTE +.386cc0 af 42 00 00 lda $000042 LDA @lRAD_LINE +.386cc4 10 97 bpl $386c5d BPL READ_PATTERN_10 +.386cc6 60 rts RTS +.386cc7 DRAW_BLANKS +.386cc7 5a phy PHY +.386cc8 da phx PHX +.386cc9 a2 12 00 ldx #$0012 LDX #18 +.386ccc a0 00 00 ldy #$0000 LDY #0 +.386ccf a9 2d lda #$2d LDA #'-' +.386cd1 BL_NEXT +.386cd1 97 0c sta [$0c],y STA [SCREENBEGIN], Y +.386cd3 c8 iny INY +.386cd4 ca dex DEX +.386cd5 d0 fa bne $386cd1 BNE BL_NEXT +.386cd7 fa plx PLX +.386cd8 7a ply PLY +.386cd9 60 rts RTS +.386cda DISPLAY_RAD_PTN_DEST +.386cda 5a phy PHY +.386cdb a5 f6 lda $f6 LDA RAD_PTN_DEST+2 +.386cdd 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386ce0 c8 iny INY +.386ce1 c8 iny INY +.386ce2 a5 f5 lda $f5 LDA RAD_PTN_DEST+1 +.386ce4 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386ce7 c8 iny INY +.386ce8 c8 iny INY +.386ce9 a5 f4 lda $f4 LDA RAD_PTN_DEST +.386ceb 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386cee 7a ply PLY +.386cef 60 rts RTS +.386cf0 WRITE_A_LNG +.386cf0 48 pha PHA +.386cf1 48 pha PHA +.386cf2 e2 20 sep #$20 SEP #$20 ; set A short +.386cf4 68 pla PLA +.386cf5 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386cf8 88 dey DEY +.386cf9 88 dey DEY +.386cfa 68 pla PLA +.386cfb 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386cfe c2 20 rep #$20 REP #$20 ; set A long +.386d00 68 pla PLA +.386d01 60 rts RTS +.386d02 RAD_ALL_NOTES_OFF +.386d02 5a phy PHY +.386d03 c2 20 rep #$20 REP #$20 ; set A long +.386d05 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE +.386d08 85 2c sta $2c STA OPL2_IND_ADDY_LL +.386d0a a9 af 00 lda #$00af LDA #`OPL3_R_BASE +.386d0d 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 +.386d0f e2 20 sep #$20 SEP #$20 ; set A short +.386d11 a0 a0 00 ldy #$00a0 LDY #$A0 +.386d14 a9 00 lda #$00 LDA #0 +.386d16 NEXT_NOTE_OFF +.386d16 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386d18 c8 iny INY +.386d19 c0 b9 00 cpy #$00b9 CPY #$B9 +.386d1c d0 f8 bne $386d16 BNE NEXT_NOTE_OFF +.386d1e 7a ply PLY +.386d1f 60 rts RTS +.386d20 RAD_PLAYNOTES +.386d20 5a phy PHY +.386d21 20 c7 6c jsr $386cc7 JSR DRAW_BLANKS +.386d24 c2 20 rep #$20 REP #$20 ; set A long +.386d26 af 18 0f 38 lda $380f18 LDA PATTERN_NUM +.386d2a 29 ff 00 and #$00ff AND #$FF +.386d2d 3a dec a DEC A ; start at 0 +.386d2e 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.386d32 a9 01 07 lda #$0701 LDA #PATTERN_BYTES +.386d35 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.386d39 af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.386d3d 1a inc a INC A ; skip the pattern number byte +.386d3e 85 f4 sta $f4 STA RAD_PTN_DEST +.386d40 e2 20 sep #$20 SEP #$20 ; set A short +.386d42 a9 39 lda #$39 LDA #<`PATTERNS +.386d44 85 f6 sta $f6 STA RAD_PTN_DEST + 2 +.386d46 a0 a0 00 ldy #$00a0 LDY #SCREEN_WIDTH * 2 +.386d49 20 da 6c jsr $386cda JSR DISPLAY_RAD_PTN_DEST ; display the address of the pattern +.386d4c c2 20 rep #$20 REP #$20 ; set A long +.386d4e a5 6c lda $6c LDA LINE_NUM_HEX +.386d50 29 7f 00 and #$007f AND #$7F +.386d53 8f 00 01 00 sta $000100 STA @lUNSIGNED_MULT_A +.386d57 a9 1c 00 lda #$001c LDA #LINE_BYTES +.386d5a 8f 02 01 00 sta $000102 STA @lUNSIGNED_MULT_B +.386d5e af 04 01 00 lda $000104 LDA @lUNSIGNED_MULT_RESULT +.386d62 1a inc a INC A ; skip the line number byte +.386d63 a0 52 00 ldy #$0052 LDY #SCREEN_WIDTH + 2 +.386d66 20 f0 6c jsr $386cf0 JSR WRITE_A_LNG ; display the line offset from the pattern address +.386d69 a8 tay TAY ; Y contains the line offset +.386d6a a9 00 00 lda #$0000 LDA #0 +.386d6d e2 20 sep #$20 SEP #$20 ; set A short +.386d6f 64 28 stz $28 STZ OPL2_REG_REGION +.386d71 PN_NEXT_NOTE +.386d71 8f 27 00 00 sta $000027 STA @lOPL2_CHANNEL +.386d75 aa tax TAX +.386d76 bf 1d 69 38 lda $38691d,x LDA CHANNELS,X +.386d7a d0 05 bne $386d81 BNE PN_PLAY_NOTE +.386d7c c8 iny INY ; skip the channel data +.386d7d c8 iny INY +.386d7e c8 iny INY +.386d7f 80 58 bra $386dd9 BRA PN_CONTINUE +.386d81 PN_PLAY_NOTE +.386d81 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; octave/note +.386d83 29 7f and #$7f AND #$7F +.386d85 20 40 6f jsr $386f40 JSR RAD_WRITE_OCT_NOTE +.386d88 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; bit 7 is bit 4 of the instrument number +.386d8a 29 80 and #$80 AND #$80 +.386d8c 4a lsr a LSR A +.386d8d 4a lsr a LSR A +.386d8e 4a lsr a LSR A +.386d8f 85 4e sta $4e STA RAD_TEMP +.386d91 c8 iny INY +.386d92 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; instrument/effect +.386d94 29 f0 and #$f0 AND #$F0 +.386d96 4a lsr a LSR A +.386d97 4a lsr a LSR A +.386d98 4a lsr a LSR A +.386d99 4a lsr a LSR A +.386d9a 65 4e adc $4e ADC RAD_TEMP +.386d9c f0 14 beq $386db2 BEQ SKIP_INSTRUMENT +.386d9e 3a dec a DEC A ; instruments are starting at 0 +.386d9f 8f 6a 00 00 sta $00006a STA @lINSTR_NUMBER +.386da3 5a phy PHY +.386da4 a6 27 ldx $27 LDX OPL2_CHANNEL +.386da6 a9 00 lda #$00 LDA #0 +.386da8 eb xba XBA +.386da9 bf 18 10 38 lda $381018,x LDA @lregisterOffsets_operator0,X +.386dad aa tax TAX +.386dae 20 b9 65 jsr $3865b9 JSR LOAD_INSTRUMENT +.386db1 7a ply PLY +.386db2 SKIP_INSTRUMENT +.386db2 af 30 00 00 lda $000030 LDA @lOPL2_NOTE +.386db6 f0 11 beq $386dc9 BEQ SKIP_NOTE ; if the note is 0, don't play anything. +.386db8 c9 0f cmp #$0f CMP #$0F ; NOTE OFF +.386dba f0 2b beq $386de7 BEQ RAD_NOTE_OFF +.386dbc c2 20 rep #$20 REP #$20 ; set A long +.386dbe 5a phy PHY +.386dbf 20 f5 37 jsr $3837f5 JSR OPL2_GET_REG_OFFSET +.386dc2 22 01 32 38 jsl $383201 JSL OPL2_PLAYNOTE +.386dc6 7a ply PLY +.386dc7 e2 20 sep #$20 SEP #$20 ; set A short +.386dc9 SKIP_NOTE +.386dc9 a9 00 lda #$00 LDA #0 +.386dcb eb xba XBA +.386dcc b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; instrument/effect +.386dce c8 iny INY +.386dcf 29 0f and #$0f AND #$F +.386dd1 f0 05 beq $386dd8 BEQ SKIP_EFFECT +.386dd3 0a asl a ASL A ; double bytes +.386dd4 aa tax TAX +.386dd5 fc f8 6d jsr ($386df8,x) JSR (RAD_EFFECT_TABLE,X) +.386dd8 SKIP_EFFECT +.386dd8 c8 iny INY +.386dd9 PN_CONTINUE +.386dd9 a9 00 lda #$00 LDA #0 ; clear B +.386ddb eb xba XBA +.386ddc af 27 00 00 lda $000027 LDA @lOPL2_CHANNEL +.386de0 1a inc a INC A +.386de1 c9 09 cmp #$09 CMP #9 +.386de3 d0 8c bne $386d71 BNE PN_NEXT_NOTE +.386de5 7a ply PLY +.386de6 60 rts RTS +.386de7 RAD_NOTE_OFF +.386de7 af 27 00 00 lda $000027 LDA @lOPL2_CHANNEL +.386deb 18 clc CLC +.386dec 69 b0 adc #$b0 ADC #$B0 +.386dee 85 2c sta $2c STA OPL2_IND_ADDY_LL +.386df0 a9 00 lda #$00 LDA #0 +.386df2 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386df4 c8 iny INY +.386df5 c8 iny INY +.386df6 80 e1 bra $386dd9 BRA PN_CONTINUE +.386df8 RAD_EFFECT_TABLE +>386df8 18 6e .word <>RAD_EFFECT_NONE ; 00 +>386dfa 8b 6e .word <>RAD_EFFECT_NOTE_SLIDE_UP ; 01 +>386dfc 8b 6e .word <>RAD_EFFECT_NOTE_SLIDE_DOWN ; 02 +>386dfe 18 6e .word <>RAD_EFFECT_NOTE_SLIDE_TO ; 03 +>386e00 18 6e .word <>RAD_NOOP +>386e02 18 6e .word <>RAD_EFFECT_NOTE_SLIDE_VOLUME ; 05 +>386e04 18 6e .word <>RAD_NOOP +>386e06 18 6e .word <>RAD_NOOP +>386e08 18 6e .word <>RAD_NOOP +>386e0a 18 6e .word <>RAD_NOOP +>386e0c 19 6e .word <>RAD_EFFECT_VOLUME_SLIDE ; 0A +>386e0e 18 6e .word <>RAD_NOOP +>386e10 01 6f .word <>RAD_EFFECT_SET_VOLUME ; 0C +>386e12 70 6e .word <>RAD_EFFECT_PATTERN_BREAK ; 0D +>386e14 18 6e .word <>RAD_NOOP +>386e16 81 6e .word <>RAD_EFFECT_SET_SPEED ; 0F +.386e18 RAD_NOOP +.386e18 RAD_EFFECT_NONE +.386e18 RAD_EFFECT_NOTE_SLIDE_TO +.386e18 RAD_EFFECT_NOTE_SLIDE_VOLUME +.386e18 60 rts RTS +.386e19 RAD_EFFECT_VOLUME_SLIDE +.386e19 5a phy PHY +.386e1a b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; store value of the effect in RAD_CHANNE_EFFCT +.386e1c 85 4c sta $4c STA RAD_CHANNE_EFFCT +.386e1e c2 20 rep #$20 REP #$20 ; set A long +.386e20 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE +.386e23 85 2c sta $2c STA OPL2_IND_ADDY_LL +.386e25 a9 af 00 lda #$00af LDA #`OPL3_R_BASE +.386e28 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 +.386e2a e2 30 sep #$30 SEP #$30 ; set A&X short +.386e2c a5 27 lda $27 LDA OPL2_CHANNEL +.386e2e aa tax TAX +.386e2f bf 18 10 38 lda $381018,x LDA @lregisterOffsets_operator0,X +.386e33 18 clc CLC +.386e34 69 40 adc #$40 ADC #$40 +.386e36 a8 tay TAY +.386e37 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; volume +.386e39 48 pha PHA +.386e3a 29 3f and #$3f AND #$3F +.386e3c 18 clc CLC +.386e3d 65 4c adc $4c ADC RAD_CHANNE_EFFCT ; check for values greater than 50 +.386e3f c9 40 cmp #$40 CMP #$40 ; if there's an overflow, use #$3F (low volume) +.386e41 90 02 bcc $386e45 BCC NO_OVERFLOW_0 +.386e43 a9 3f lda #$3f LDA #$3F +.386e45 NO_OVERFLOW_0 +.386e45 29 3f and #$3f AND #$3F +.386e47 85 4e sta $4e STA RAD_TEMP +.386e49 68 pla PLA +.386e4a 29 c0 and #$c0 AND #$C0 +.386e4c 05 4e ora $4e ORA RAD_TEMP +.386e4e 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386e50 c8 iny INY +.386e51 c8 iny INY +.386e52 c8 iny INY +.386e53 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; volume +.386e55 48 pha PHA +.386e56 29 3f and #$3f AND #$3F +.386e58 18 clc CLC +.386e59 65 4c adc $4c ADC RAD_CHANNE_EFFCT +.386e5b c9 40 cmp #$40 CMP #$40 ; if there's an overflow, use #$3F (low volume) +.386e5d 90 02 bcc $386e61 BCC NO_OVERFLOW_1 +.386e5f a9 3f lda #$3f LDA #$3F +.386e61 NO_OVERFLOW_1 +.386e61 29 3f and #$3f AND #$3F +.386e63 85 4e sta $4e STA RAD_TEMP +.386e65 68 pla PLA +.386e66 29 c0 and #$c0 AND #$C0 +.386e68 05 4e ora $4e ORA RAD_TEMP +.386e6a 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386e6c c2 10 rep #$10 REP #$10 ; set X long +.386e6e 7a ply PLY +.386e6f 60 rts RTS +.386e70 RAD_EFFECT_PATTERN_BREAK +.386e70 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; effect parameter +.386e72 3a dec a DEC A ; DECREMENT by 1, because the next timer interrupt will increment at the beginning +.386e73 85 6c sta $6c STA LINE_NUM_HEX +.386e75 a9 00 lda #$00 LDA #0 ; convert the effect to a decimal line number +.386e77 8f 19 0f 38 sta $380f19 STA @lLINE_NUM_DEC +.386e7b 20 05 65 jsr $386505 JSR INCREMENT_ORDER +.386e7e 7a ply PLY ; don't return to the calling method, return to the parent +.386e7f 7a ply PLY +.386e80 60 rts RTS +.386e81 RAD_EFFECT_SET_SPEED +.386e81 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; effect parameter +.386e83 8f d4 6a 38 sta $386ad4 STA @lTuneInfo.InitialSpeed +.386e87 20 a1 5a jsr $385aa1 JSR DISPLAY_SPEED +.386e8a 60 rts RTS +.386e8b RAD_EFFECT_NOTE_SLIDE_UP +.386e8b RAD_EFFECT_NOTE_SLIDE_DOWN +.386e8b 5a phy PHY +.386e8c 4a lsr a LSR +.386e8d 85 50 sta $50 STA RAD_EFFECT ; 1 slide down, 2 slide up +.386e8f b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; store value of the effect in RAD_CHANNE_EFFCT +.386e91 85 4c sta $4c STA RAD_CHANNE_EFFCT +.386e93 c2 20 rep #$20 REP #$20 ; set A long +.386e95 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE +.386e98 85 2c sta $2c STA OPL2_IND_ADDY_LL +.386e9a a9 af 00 lda #$00af LDA #`OPL3_R_BASE +.386e9d 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 +.386e9f e2 30 sep #$30 SEP #$30 ; set A&X short +.386ea1 a5 27 lda $27 LDA OPL2_CHANNEL +.386ea3 18 clc CLC +.386ea4 69 a0 adc #$a0 ADC #$A0 +.386ea6 a8 tay TAY +.386ea7 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; read low fnumber byte +.386ea9 c2 10 rep #$10 REP #$10 ; set X long +.386eab bb tyx TYX +.386eac a0 5a 00 ldy #$005a LDY #SCREEN_WIDTH + 10 +.386eaf 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386eb2 9b txy TXY +.386eb3 e2 10 sep #$10 SEP #$10 ; set X short +.386eb5 48 pha PHA ; store A on the stack +.386eb6 98 tya TYA +.386eb7 18 clc CLC +.386eb8 69 10 adc #$10 ADC #$10 +.386eba a8 tay TAY +.386ebb b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y ; read bits 0,1 of high fnumber +.386ebd 85 4e sta $4e STA RAD_TEMP ; store the entire value of $B0 +.386ebf c2 10 rep #$10 REP #$10 ; set X long +.386ec1 bb tyx TYX +.386ec2 a0 a8 00 ldy #$00a8 LDY #SCREEN_WIDTH * 2 + 8 +.386ec5 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386ec8 29 03 and #$03 AND #3 +.386eca a0 58 00 ldy #$0058 LDY #SCREEN_WIDTH + 8 +.386ecd 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386ed0 9b txy TXY +.386ed1 eb xba XBA +.386ed2 68 pla PLA ; A is now the FNUMBER +.386ed3 aa tax TAX ; X is now the FNUMBER +.386ed4 a5 50 lda $50 LDA RAD_EFFECT +.386ed6 89 02 bit #$02 BIT #2 +.386ed8 f0 0a beq $386ee4 BEQ SLIDE_UP +.386eda c2 20 rep #$20 REP #$20 ; set A long +.386edc 8a txa TXA +.386edd 38 sec SEC +.386ede e5 4c sbc $4c SBC RAD_CHANNE_EFFCT ; substract the effect parameter +.386ee0 e2 20 sep #$20 SEP #$20 ; set A short +.386ee2 80 08 bra $386eec BRA FINISH_SLIDE +.386ee4 SLIDE_UP +.386ee4 c2 20 rep #$20 REP #$20 ; set A long +.386ee6 8a txa TXA +.386ee7 18 clc CLC +.386ee8 65 4c adc $4c ADC RAD_CHANNE_EFFCT ; substract the effect parameter +.386eea e2 20 sep #$20 SEP #$20 ; set A short +.386eec FINISH_SLIDE +.386eec e2 10 sep #$10 SEP #$10 ; set X short +.386eee eb xba XBA +.386eef 29 03 and #$03 AND #3 +.386ef1 05 4e ora $4e ORA RAD_TEMP +.386ef3 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386ef5 98 tya TYA +.386ef6 38 sec SEC +.386ef7 e9 10 sbc #$10 SBC #$10 +.386ef9 a8 tay TAY +.386efa eb xba XBA +.386efb 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386efd c2 10 rep #$10 REP #$10 ; set X long +.386eff 7a ply PLY +.386f00 60 rts RTS +.386f01 RAD_EFFECT_SET_VOLUME +.386f01 5a phy PHY +.386f02 c2 20 rep #$20 REP #$20 ; set A long +.386f04 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE +.386f07 85 2c sta $2c STA OPL2_IND_ADDY_LL +.386f09 a9 af 00 lda #$00af LDA #`OPL3_R_BASE +.386f0c 85 2e sta $2e STA OPL2_IND_ADDY_LL + 2 +.386f0e e2 20 sep #$20 SEP #$20 ; set A short +.386f10 b7 f4 lda [$f4],y LDA [RAD_PTN_DEST],Y ; effect parameter +.386f12 29 7f and #$7f AND #$7F +.386f14 f0 01 beq $386f17 BEQ HANDLE_ZERO +.386f16 3a dec a DEC A +.386f17 HANDLE_ZERO +.386f17 49 3f eor #$3f EOR #$3F ; complement +.386f19 85 4e sta $4e STA RAD_TEMP +.386f1b e2 10 sep #$10 SEP #$10 ; set X short +.386f1d a6 27 ldx $27 LDX OPL2_CHANNEL +.386f1f bf 18 10 38 lda $381018,x LDA @lregisterOffsets_operator0,X +.386f23 18 clc CLC +.386f24 69 40 adc #$40 ADC #$40 +.386f26 a8 tay TAY +.386f27 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y +.386f29 29 c0 and #$c0 AND #$C0 ; +.386f2b 18 clc CLC +.386f2c 65 4e adc $4e ADC RAD_TEMP +.386f2e 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386f30 c8 iny INY +.386f31 c8 iny INY +.386f32 c8 iny INY +.386f33 b7 2c lda [$2c],y LDA [OPL2_IND_ADDY_LL],Y +.386f35 29 c0 and #$c0 AND #$C0 ; +.386f37 18 clc CLC +.386f38 65 4e adc $4e ADC RAD_TEMP +.386f3a 97 2c sta [$2c],y STA [OPL2_IND_ADDY_LL],Y +.386f3c c2 10 rep #$10 REP #$10 ; set X long +.386f3e 7a ply PLY +.386f3f 60 rts RTS +.386f40 RAD_WRITE_OCT_NOTE +.386f40 5a phy PHY +.386f41 48 pha PHA +.386f42 48 pha PHA +.386f43 af 27 00 00 lda $000027 LDA @lOPL2_CHANNEL +.386f47 0a asl a ASL A ; multiply the channel by 2 for the screen position +.386f48 a8 tay TAY +.386f49 68 pla PLA +.386f4a f0 03 beq $386f4f BEQ DONT_DISPLAY_00 +.386f4c 20 a3 57 jsr $3857a3 JSR WRITE_HEX +.386f4f DONT_DISPLAY_00 +.386f4f 29 70 and #$70 AND #$70 ; octave +.386f51 4a lsr a LSR +.386f52 4a lsr a LSR +.386f53 4a lsr a LSR +.386f54 4a lsr a LSR +.386f55 8f 31 00 00 sta $000031 STA @lOPL2_OCTAVE +.386f59 68 pla PLA +.386f5a 29 0f and #$0f AND #$0F ; note +.386f5c 8f 30 00 00 sta $000030 STA @lOPL2_NOTE +.386f60 7a ply PLY +.386f61 60 rts RTS +.386f62 RAD_SETINSTRUMENT +.386f62 5a phy PHY +.386f63 e2 20 sep #$20 SEP #$20 ; set A short +.386f65 a9 01 lda #$01 LDA #$01 +.386f67 85 26 sta $26 STA OPL2_OPERATOR +.386f69 c2 20 rep #$20 REP #$20 ; set A long +.386f6b a9 38 00 lda #$0038 LDA #<`INSTRUMENT_ACCORDN +.386f6e 85 0a sta $0a STA OPL2_ADDY_PTR_HI +.386f70 a5 32 lda $32 LDA OPL2_PARAMETER0 +.386f72 29 ff 00 and #$00ff AND #$00FF +.386f75 3a dec a DEC A +.386f76 0a asl a ASL A +.386f77 0a asl a ASL A +.386f78 0a asl a ASL A +.386f79 0a asl a ASL A +.386f7a 18 clc CLC +.386f7b 69 3b 10 adc #$103b ADC #<>INSTRUMENT_ACCORDN +.386f7e 85 08 sta $08 STA OPL2_ADDY_PTR_LO +.386f80 c2 20 rep #$20 REP #$20 ; set A long +.386f82 a9 20 00 lda #$0020 LDA #$0020 +.386f85 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386f89 e2 20 sep #$20 SEP #$20 ; set A short +.386f8b a0 00 00 ldy #$0000 LDY #$0000 +.386f8e b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386f90 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386f92 c2 20 rep #$20 REP #$20 ; set A long +.386f94 a9 40 00 lda #$0040 LDA #$0040 +.386f97 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386f9b e2 20 sep #$20 SEP #$20 ; set A short +.386f9d a0 02 00 ldy #$0002 LDY #$0002 +.386fa0 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386fa2 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386fa4 c2 20 rep #$20 REP #$20 ; set A long +.386fa6 a9 60 00 lda #$0060 LDA #$0060 +.386fa9 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386fad e2 20 sep #$20 SEP #$20 ; set A short +.386faf a0 04 00 ldy #$0004 LDY #$0004 +.386fb2 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386fb4 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386fb6 c2 20 rep #$20 REP #$20 ; set A long +.386fb8 a9 80 00 lda #$0080 LDA #$0080 +.386fbb 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386fbf e2 20 sep #$20 SEP #$20 ; set A short +.386fc1 a0 06 00 ldy #$0006 LDY #$0006 +.386fc4 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386fc6 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386fc8 c2 20 rep #$20 REP #$20 ; set A long +.386fca a9 e0 00 lda #$00e0 LDA #$00E0 +.386fcd 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386fd1 e2 20 sep #$20 SEP #$20 ; set A short +.386fd3 a0 09 00 ldy #$0009 LDY #$0009 +.386fd6 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386fd8 29 0f and #$0f AND #$0F +.386fda 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386fdc a9 00 lda #$00 LDA #$00 +.386fde 85 26 sta $26 STA OPL2_OPERATOR +.386fe0 c2 20 rep #$20 REP #$20 ; set A long +.386fe2 a9 20 00 lda #$0020 LDA #$0020 +.386fe5 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386fe9 e2 20 sep #$20 SEP #$20 ; set A short +.386feb a0 01 00 ldy #$0001 LDY #$0001 +.386fee b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.386ff0 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.386ff2 c2 20 rep #$20 REP #$20 ; set A long +.386ff4 a9 40 00 lda #$0040 LDA #$0040 +.386ff7 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.386ffb e2 20 sep #$20 SEP #$20 ; set A short +.386ffd a0 03 00 ldy #$0003 LDY #$0003 +.387000 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.387002 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.387004 c2 20 rep #$20 REP #$20 ; set A long +.387006 a9 60 00 lda #$0060 LDA #$0060 +.387009 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.38700d e2 20 sep #$20 SEP #$20 ; set A short +.38700f a0 05 00 ldy #$0005 LDY #$0005 +.387012 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.387014 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.387016 c2 20 rep #$20 REP #$20 ; set A long +.387018 a9 80 00 lda #$0080 LDA #$0080 +.38701b 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.38701f e2 20 sep #$20 SEP #$20 ; set A short +.387021 a0 71 00 ldy #$0071 LDY #$00071 +.387024 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.387026 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.387028 c2 20 rep #$20 REP #$20 ; set A long +.38702a a9 e0 00 lda #$00e0 LDA #$00E0 +.38702d 22 f5 37 38 jsl $3837f5 JSL OPL2_GET_REG_OFFSET +.387031 e2 20 sep #$20 SEP #$20 ; set A short +.387033 a0 09 00 ldy #$0009 LDY #$0009 +.387036 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.387038 29 f0 and #$f0 AND #$F0 +.38703a 4a lsr a LSR A +.38703b 4a lsr a LSR A +.38703c 4a lsr a LSR A +.38703d 4a lsr a LSR A +.38703e 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.387040 a5 27 lda $27 LDA OPL2_CHANNEL +.387042 18 clc CLC +.387043 29 0f and #$0f AND #$0F ; This is just precaution, it should be between 0 to 8 +.387045 69 c0 adc #$c0 ADC #$C0 +.387047 85 2a sta $2a STA OPL2_REG_OFFSET +.387049 a9 00 lda #$00 LDA #$00 +.38704b 85 2b sta $2b STA OPL2_REG_OFFSET+1; +.38704d c2 30 rep #$30 REP #$30 ; set A&X long +.38704f 18 clc CLC +.387050 a9 00 e7 lda #$e700 LDA #<>OPL3_R_BASE +.387053 65 2a adc $2a ADC OPL2_REG_OFFSET +.387055 85 2c sta $2c STA OPL2_IND_ADDY_LL +.387057 a9 af 00 lda #$00af LDA #`OPL3_R_BASE +.38705a 85 2e sta $2e STA OPL2_IND_ADDY_HL +.38705c e2 20 sep #$20 SEP #$20 ; set A short +.38705e a0 08 00 ldy #$0008 LDY #$0008 +.387061 b7 08 lda [$08],y LDA [OPL2_ADDY_PTR_LO],Y +.387063 87 2c sta [$2c] STA [OPL2_IND_ADDY_LL] +.387065 7a ply PLY +.387066 60 rts RTS ;****** Return to file: tracker.asm