Understanding MagicKit Demo Sources
Posted: Sun Oct 26, 2014 8:22 pm
Hi there.
I have been reading the 4 Chapters of Rich Tutorials and surely have a better understanding now of the whole structure, banks etc. Still struggling with reading through the ASM Codes on the Demos provided in MagicKit but this is mostly because of yet unknown EQU.
What I am doing is working with the STARWAVE Code (seems to be covering the most things at once) and trying to change things etc.
I have stripped out everything but the scroller and it works fine so far. Two things I am not really clear what they do though - maybe somebody here can help:
This is the Interrupt setting done before the Loop. I get that setvec points the HSYNC to a routine in the demo. This does update a few things like make the water wiggle etc.
What I am not sure is the next part.
vreg #05 - i assume that this is that register (taken from chapter_0.txt on the tutorials)
$05 - (CR) The control register is used to enable/disabled BG or sprites,
auto incrementor, Vblank/hblank/sprite overflow/collision flags.
Why do I write #$CC into video_data_l which is the Data Port (if I am correct)? and the same value to $20F3? It says its the VDC Control Register in EQU.INC?
And my second question is about this routine:
The way I read this in the tutorial was store the value of the scanline where you want the vsync to trigger but add #$40 to it before. So if I want the vsync irq to happen at line 80 I would do take i would store b0..
why does this store a word and not a byte?
Thank you and sorry if this might sound like a really lame question
Roland
I have been reading the 4 Chapters of Rich Tutorials and surely have a better understanding now of the whole structure, banks etc. Still struggling with reading through the ASM Codes on the Demos provided in MagicKit but this is mostly because of yet unknown EQU.
What I am doing is working with the STARWAVE Code (seems to be covering the most things at once) and trying to change things etc.
I have stripped out everything but the scroller and it works fine so far. Two things I am not really clear what they do though - maybe somebody here can help:
Code: Select all
; set interrupt vector
setvec #HSYNC,hsync_proc
vec_on #HSYNC
smb #7,<irq_m
; enable HSYNC interrupt
vreg #5
lda #$cc
sta video_data_l
sta vdc_crl
What I am not sure is the next part.
vreg #05 - i assume that this is that register (taken from chapter_0.txt on the tutorials)
$05 - (CR) The control register is used to enable/disabled BG or sprites,
auto incrementor, Vblank/hblank/sprite overflow/collision flags.
Why do I write #$CC into video_data_l which is the Data Port (if I am correct)? and the same value to $20F3? It says its the VDC Control Register in EQU.INC?
And my second question is about this routine:
Code: Select all
vsync_proc:
vreg #6 ; restart the scanline counter on the first
stw #$40,video_data ; line
stw #$40,<scanline
rts
why does this store a word and not a byte?
Thank you and sorry if this might sound like a really lame question
Roland