polomint

Loading the loading screen from disk

Jan 15th, 2022
772
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;
  2. ;
  3. ;
  4. ;
  5.  
  6. .OSFILEDATA
  7. .OSFD_Filename
  8.     EQUB 0, 0
  9. .OSFD_LoadAddress
  10.     EQUB 0, 0, 0, 0
  11. .OSFD_ExecutionAddress
  12.     EQUB 0, 0, 0, 0
  13. .OSFD_StartReadWriteOperations
  14.     EQUB 0, 0, 0, 0
  15. .OSFD_EndReadWriteOperations
  16.     EQUB 0, 0, 0, 0
  17.  
  18. .TitleScreenFilename
  19.     EQUS "tscr", 13
  20.  
  21. .LoadTitleScreen
  22. {
  23.     ; Setup the parameter block
  24.     LDX #0
  25.     LDA #TitleScreenFilename MOD 256:STA OSFD_Filename
  26.     LDA #TitleScreenFilename DIV 256:STA OSFD_Filename + 1
  27.  
  28.     LDA #SCREEN_START_MODE_2 MOD 256:STA OSFD_LoadAddress
  29.     LDA #SCREEN_START_MODE_2 DIV 256:STA OSFD_LoadAddress + 1
  30.     STX OSFD_LoadAddress + 2
  31.     STX OSFD_LoadAddress + 3
  32.  
  33.     STX OSFD_ExecutionAddress
  34.     STX OSFD_ExecutionAddress + 1
  35.     STX OSFD_ExecutionAddress + 2
  36.     STX OSFD_ExecutionAddress + 3
  37.  
  38.     STX OSFD_StartReadWriteOperations
  39.     LDA #&50    ; &5000 == 20480 == 20K == Length of the title screen data
  40.     STA OSFD_StartReadWriteOperations + 1
  41.     STX OSFD_StartReadWriteOperations + 2
  42.     STX OSFD_StartReadWriteOperations + 3
  43.  
  44.     STX OSFD_EndReadWriteOperations
  45.     LDA #&80    ; End address of the data
  46.     STA OSFD_EndReadWriteOperations + 1
  47.     STX OSFD_EndReadWriteOperations + 2
  48.     STX OSFD_EndReadWriteOperations + 3
  49.  
  50.     LDX #OSFILEDATA MOD 256
  51.     LDY #OSFILEDATA DIV 256
  52.     LDA #&FF    ; indicate to load the file direct to memory
  53.  
  54.     JSR OSFILE
  55.  
  56.     ; Titlescreen image should be displayed... I hope!
  57.    
  58.     RTS
  59. }
  60.  
RAW Paste Data