Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Understanding the examples: demo_seq
#2
(2020-09-25, 10:10 PM)shazz Wrote: 1. S_BASE

From the docs, S_BASE is the memory location where to fetch bitmap data from.
So, it should point to the start of the logo data right ?

But in the code I see:

MOV    VREG_PBS_BASEL, <(mhl_logo - dl_start)
MOV    VREG_PBS_BASEH, >(mhl_logo - dl_start)

Why dl_start address should be subtracted to the logo address ?

The example's linker configuration initially puts the display list data in the same segment as the code. So when the PRG is loaded into memory, the display list and logo are in regular C64 RAM, somewhere around location $880. To make them accessible to VASYL, they need to be copied to its local memory, and this is what happens in copy_and_activate_dlist. That procedure takes everything between labels dlist and dlend and copies it to the start of VASYL memory - address $0 and on. This means that whenever you are referring to a label in the local memory, you need to subtract the original starting address in C64 RAM, which happens to be dl_start (or dlist, which is the same).

Come to think of it, this could be more clearly done using a dedicated segment for VASYL data. Good thing the weekend is starting, expect updates to the repo soon. Smile

I will tackle the other questions tomorrow. Incidentally, this weekend we will also publish the "Sequencer Programming" section of the docs, which should make this topic much clearer.
Reply


Messages In This Thread
Understanding the examples: demo_seq - by shazz - 2020-09-25, 10:10 PM
RE: Understanding the examples: demo_seq - by laubzega - 2020-09-26, 07:32 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)