Jump to content

paradoxnj

Members
  • Posts

    11
  • Joined

  • Last visited

About paradoxnj

  • Birthday 08/24/1973

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

paradoxnj's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Yep...thanks. I put it there after I posted this. I realized it was missing. Edited the post to reflect it. Thanks again. I also just realized that I have the check backwards. It should be success if the carry is not set.
  2. I finally got the function working correctly. I had to use the Zero Page for some of the function arguments, but the function is repeatable now. The given example shows how I load a palette file into VRAM at the VERA palette location. Again...this is using Kick Assembler. /********************************************************************* ; Function: loadIntoVRAM ; Uses: A = filenameLength ; X = filename msb ; Y = filename lsb ; ZP_ARG1 = ADDR_LO ; ZP_ARG2 = ADDR_MID ; ZP_ARG3 = ADDR_HI ; Returns: A = 0 on success ; 1 on failure ; Description: Loads a file into VRAM **********************************************************************/ loadIntoVRAM: { jsr CX16.SETNAM lda #1 ldx #CX16.HOST_DEVICE ldy #0 jsr CX16.SETLFS lda CX16.ZP_ARG3 ldx CX16.ZP_ARG1 ldy CX16.ZP_ARG2 clc jsr CX16.LOAD bcs errfile lda #0 rts errfile: lda #1 rts } Used like this: lda #((CX16.VRAM_palette >> 16) & $F) + 2 sta CX16.ZP_ARG3 lda #<(CX16.VRAM_palette & $FF00) >> 8 sta CX16.ZP_ARG2 lda #>(CX16.VRAM_palette & $FF) sta CX16.ZP_ARG1 ldx #<bmp_pal ldy #>bmp_pal lda #(bmp_pal_end-bmp_pal) jsr loadIntoVRAM
  3. Sorry for the late reply....LOAD uses the carry bit to signify an error in loading. http://c64os.com/post/c64kernalrom#file_load
  4. Refined the macro a bit more and got rid of the clc and adc instructions. .macro loadVRAM(filename, filenameLength, address) { lda #filenameLength ldx #<filename ldy #>filename jsr CX16.SETNAM lda #1 ldx #CX16.HOST_DEVICE ldy #0 jsr CX16.SETLFS ldx #<(address & $FFFF) ldy #>(address & $FFFF) lda #(((address >> 16) & $F) + 2) clc jsr CX16.LOAD }
  5. Finally got it!!! I used a macro instead of a function for load_file_into_vram. I was able to abstract the bank that way and keep it like a function call. I know that is repetitive code in the end and I will still work to get that correct but for now it works. .macro loadVRAM(filename, filenameLength, address) { lda #filenameLength ldx #<filename ldy #>filename jsr CX16.SETNAM lda #1 ldx #CX16.HOST_DEVICE ldy #0 jsr CX16.SETLFS ldx #<(address & $FFFF) ldy #>(address & $FFFF) lda #((address >> 16) & $F) clc adc #2 clc jsr CX16.LOAD } bmp_pal: .text "FF1TS1-X16.PAL" bmp_pal_end: loadVRAM(bmp_pal, bmp_pal_end-bmp_pal, CX16.VRAM_palette) loadVRAM(bmp_file, bmp_file_end-bmp_file, VRAM_TILES) This is just a full screen render of a bitmap I had. I am using it for learning as the tiles are 16x16. Now to figure out tile mode using this bitmap.
  6. I made some progress today. I loaded the palette using the "Kick Assembler" way and copied it to VRAM. Now the palette is red and I also found out that the image is actually being loaded even though it is giving me a "FILE NOT FOUND" error and the carry flag is being set. The "Kick Assembler" way is as follows: .var palette = LoadBinary("FF1TS1.PAL", BF_C64FILE) bmp_palette: .fill palette.getSize(), palette.uget(i)
  7. 1. Host file system. The files are in the same directory as the emulator executable. 2. Kick Assembler does translate. I see the names in the emulator memory correctly using the emulator debugger.
  8. Yep...that's what I have been using. It is how I verified the VRAM address.
  9. Ahh...thanks for the VRAM bank find. I will look at the filename address a bit more. I can use my print_string function to see what the file name is being set to.
  10. Sort of like in Chasevault...just formatted for Kick Assembler.
  11. After being semi-successful with C, I am trying my hand at assembler again. I am running into an issue loading data directly into VRAM. Using the emulator's debugging feature, I see my load function is using the correct address. and I have the bank hard coded to "2" right now. I am using Kick Assembler with Visual Studio Code. My function is as follows: My function call, looks like this: I keep getting a "FILE NOT FOUND" error ($04) and static on the screen. Any help would be appreciated.
×
×
  • Create New...

Important Information

Please review our Terms of Use