1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Added MEGA65 example of music playing using memory banking.

This commit is contained in:
jespergravgaard 2020-09-22 21:27:07 +02:00
parent 79963be64c
commit 7f5a20140b
9 changed files with 3573 additions and 0 deletions

View File

@ -2237,3 +2237,20 @@ tax
tay
//FRAGMENT vbuzz=vbuaa
taz
//FRAGMENT _deref_pbuc1_neq_vbuc2_then_la1
lda #{c2}
cmp {c1}
bne {la1}
//FRAGMENT _deref_pbuc1=_inc__deref_pbuc1
inc {c1}
//FRAGMENT _deref_pbuc1=_dec__deref_pbuc1
dec {c1}
//FRAGMENT _deref_pbuc1_eq_vbuc2_then_la1
lda #{c2}
cmp {c1}
beq {la1}
//FRAGMENT vwuz1=vwuc1
lda #<{c1}
sta {z1}
lda #>{c1}
sta {z1}+1

View File

@ -237,6 +237,11 @@ public class TestPrograms {
compileAndCompare("examples/nes-demo/nes-demo.c");
}
@Test
public void testMega65BankedMusic() throws IOException, URISyntaxException {
compileAndCompare("examples/mega65/banked-music.c");
}
@Test
public void testMega65MemoryMapTest() throws IOException, URISyntaxException {
compileAndCompare("examples/mega65/memorymap-test.c");

Binary file not shown.

View File

@ -0,0 +1,67 @@
// SID music located in another bank being played using memory mapping on MEGA65
// Music is Cybernoid II by Jeroen Tel released in 1988 by Hewson https://csdb.dk/sid/?id=28140
// SID relocated using http://www.linusakesson.net/software/sidreloc/index.php
#pragma target(mega65)
#pragma link("mega65_banked.ld")
#include <mega65.h>
void main() {
// Stop IRQ's
asm { sei }
// Remap [$4000-$5fff] to point to [$10000-$11fff]
memoryRemapBlock(0x40, 0x100);
// Transfer banked code/data to upper memory ($11000)
for( char *src=upperCodeData, *dst=MUSIC; dst<MUSIC_END; )
*dst++ = *src++;
// Initialize SID memory is still remapped)
(*musicInit)();
// Reset memory mapping
memoryRemap(0,0,0);
// Pointer to (unmapped) $4000 used for overwriting to demonstrate the mapping works
char* mem_destroy = MUSIC;
for(;;) {
// Overwrite data in the unmapped memory where the music is mapped in (to demonstrate that mapping works)
*mem_destroy = 0;
if(++mem_destroy==MUSIC_END) mem_destroy = MUSIC;
// Wait for the raster
while(VICII->RASTER!=0xff) ;
// Color border
(VICII->BORDER_COLOR)++;
// Remap memory to put music at $4000
memoryRemapBlock(0x40, 0x100);
// Play remapped SID
(*musicPlay)();
// Reset memory mapping
memoryRemap(0,0,0);
// Color border
(VICII->BORDER_COLOR)--;
// Wait for the raster
while(VICII->RASTER==0xff) ;
}
}
// Array containing the banked upper memory code/data to be transferred to upper memory before execution
char upperCodeData[] = kickasm {{
.segmentout [segments="Banked"]
}};
// Code and data to be put into upper memory, which will be banked into $4000
#pragma code_seg(CodeBanked)
#pragma data_seg(DataBanked)
// SID tune at an absolute address
__address(0x4000) char MUSIC[] = kickasm(resource "Cybernoid_II_4000.sid") {{
.const music = LoadSid("Cybernoid_II_4000.sid")
.fill music.size, music.getData(i)
}};
// Address after the end of the music
char * const MUSIC_END = 0x5200;
// Pointer to the music init routine
void()* musicInit = (void()*) MUSIC;
// Pointer to the music play routine
void()* musicPlay = (void()*) MUSIC+3;

View File

@ -0,0 +1,14 @@
// MEGA65 platform PRG executable with banked code and data starting in MEGA65 mode.
.file [name="%O", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$2001]
.segmentdef Code [start=$2017]
.segmentdef Data [startAfter="Code"]
.segmentdef Banked [segments="CodeBanked, DataBanked"]
.segmentdef CodeBanked [start=$4000]
.segmentdef DataBanked [startAfter="CodeBanked"]
.segment Basic
.byte $0a, $20, $0a, $00, $fe, $02, $20, $30, $00 // 10 BANK 0
.byte $15, $20, $14, $00, $9e, $20 // 20 SYS
.text toIntString(%E) // NNNN
.byte $00, $00, $00 //

View File

@ -0,0 +1,249 @@
// SID music located in another bank being played using memory mapping on MEGA65
// Music is Cybernoid II by Jeroen Tel released in 1988 by Hewson https://csdb.dk/sid/?id=28140
// SID relocated using http://www.linusakesson.net/software/sidreloc/index.php
.cpu _45gs02
// MEGA65 platform PRG executable with banked code and data starting in MEGA65 mode.
.file [name="banked-music.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$2001]
.segmentdef Code [start=$2017]
.segmentdef Data [startAfter="Code"]
.segmentdef Banked [segments="CodeBanked, DataBanked"]
.segmentdef CodeBanked [start=$4000]
.segmentdef DataBanked [startAfter="CodeBanked"]
.segment Basic
.byte $0a, $20, $0a, $00, $fe, $02, $20, $30, $00 // 10 BANK 0
.byte $15, $20, $14, $00, $9e, $20 // 20 SYS
.text toIntString(main) // NNNN
.byte $00, $00, $00 //
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Address after the end of the music
.label MUSIC_END = $5200
// Pointer to the music init routine
.label musicInit = MUSIC
// Pointer to the music play routine
.label musicPlay = MUSIC+3
.segment Code
main: {
.label dst = 2
.label src = 4
// Pointer to (unmapped) $4000 used for overwriting to demonstrate the mapping works
.label mem_destroy = 6
// asm
// Stop IRQ's
sei
// memoryRemapBlock(0x40, 0x100)
// Remap [$4000-$5fff] to point to [$10000-$11fff]
jsr memoryRemapBlock
lda #<upperCodeData
sta.z src
lda #>upperCodeData
sta.z src+1
lda #<MUSIC
sta.z dst
lda #>MUSIC
sta.z dst+1
// Transfer banked code/data to upper memory ($11000)
__b1:
// for( char *src=upperCodeData, *dst=MUSIC; dst<MUSIC_END; )
lda.z dst+1
cmp #>MUSIC_END
bcc __b2
bne !+
lda.z dst
cmp #<MUSIC_END
bcc __b2
!:
// (*musicInit)()
// Initialize SID memory is still remapped)
jsr musicInit
// memoryRemap(0,0,0)
// Reset memory mapping
lda #<0
sta.z memoryRemap.upperPageOffset
sta.z memoryRemap.upperPageOffset+1
ldz #0
sta.z memoryRemap.lowerPageOffset
sta.z memoryRemap.lowerPageOffset+1
jsr memoryRemap
lda #<MUSIC
sta.z mem_destroy
lda #>MUSIC
sta.z mem_destroy+1
__b4:
// *mem_destroy = 0
// Overwrite data in the unmapped memory where the music is mapped in (to demonstrate that mapping works)
lda #0
tay
sta (mem_destroy),y
// if(++mem_destroy==MUSIC_END)
inw.z mem_destroy
lda.z mem_destroy+1
cmp #>MUSIC_END
bne __b10
lda.z mem_destroy
cmp #<MUSIC_END
bne __b10
lda #<MUSIC
sta.z mem_destroy
lda #>MUSIC
sta.z mem_destroy+1
__b10:
// Wait for the raster
// while(VICII->RASTER!=0xff)
lda #$ff
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b10
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// memoryRemapBlock(0x40, 0x100)
// Remap memory to put music at $4000
jsr memoryRemapBlock
// (*musicPlay)()
// Play remapped SID
jsr musicPlay
// memoryRemap(0,0,0)
// Reset memory mapping
lda #<0
sta.z memoryRemap.upperPageOffset
sta.z memoryRemap.upperPageOffset+1
ldz #0
sta.z memoryRemap.lowerPageOffset
sta.z memoryRemap.lowerPageOffset+1
jsr memoryRemap
// (VICII->BORDER_COLOR)--;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// Wait for the raster
__b7:
// while(VICII->RASTER==0xff)
lda #$ff
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
beq __b7
jmp __b4
__b2:
// *dst++ = *src++
ldy #0
lda (src),y
sta (dst),y
// *dst++ = *src++;
inw.z dst
inw.z src
jmp __b1
}
// Remap a single 8K memory block in the 64K address space of the 6502 to point somewhere else in the first 1MB memory space of the MEGA65.
// All the other 8K memory blocks will not be mapped and will point to their own address in the lowest 64K of the MEGA65 memory.
// blockPage: Page address of the 8K memory block to remap (ie. the block that is remapped is $100 * the passed page address.)
// memoryPage: Page address of the memory that the block should point to in the 1MB memory space of the MEGA65.
// Ie. the memory that will be pointed to is $100 * the passed page address. Only the lower 12bits of the passed value is used.
memoryRemapBlock: {
.const pageOffset = $100-$40
.const block = $40>>5
.const blockBits = 1<<block
// memoryRemap(blockBits, pageOffset, pageOffset)
lda #<pageOffset
sta.z memoryRemap.upperPageOffset
lda #>pageOffset
sta.z memoryRemap.upperPageOffset+1
ldz #blockBits
lda #<pageOffset
sta.z memoryRemap.lowerPageOffset
lda #>pageOffset
sta.z memoryRemap.lowerPageOffset+1
jsr memoryRemap
// }
rts
}
// Remap some of the eight 8K memory blocks in the 64K address space of the 6502 to point somewhere else in the first 1MB memory space of the MEGA65.
// After the remapping the CPU will access the mapped memory whenever it uses instructions that access a remapped block.
// See section 2.3.4 in http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt for a description of the CPU memory remapper of the C65.
// remapBlocks: Indicates which 8K blocks of the 6502 address space to remap. Each bit represents one 8K block
// - bit 0 Memory block $0000-$1fff. Use constant MEMORYBLOCK_0000.
// - bit 1 Memory block $2000-$3fff. Use constant MEMORYBLOCK_2000.
// - bit 2 Memory block $4000-$5fff. Use constant MEMORYBLOCK_4000.
// - bit 3 Memory block $6000-$7fff. Use constant MEMORYBLOCK_6000.
// - bit 4 Memory block $8000-$9fff. Use constant MEMORYBLOCK_8000.
// - bit 5 Memory block $a000-$bfff. Use constant MEMORYBLOCK_A000.
// - bit 6 Memory block $c000-$dfff. Use constant MEMORYBLOCK_C000.
// - bit 7 Memory block $e000-$ffff. Use constant MEMORYBLOCK_E000.
// lowerPageOffset: Offset that will be added to any remapped blocks in the lower 32K of memory (block 0-3).
// The offset is a page offset (meaning it is multiplied by 0x100). Only the lower 12bits of the passed value is used.
// - If block 0 ($0000-$1fff) is remapped it will point to lowerPageOffset*$100.
// - If block 1 ($2000-$3fff) is remapped it will point to lowerPageOffset*$100 + $2000.
// - If block 2 ($4000-$5fff) is remapped it will point to lowerPageOffset*$100 + $4000.
// - If block 3 ($6000-$7fff) is remapped it will point to lowerPageOffset*$100 + $6000.
// upperPageOffset: Offset that will be added to any remapped blocks in the upper 32K of memory (block 4-7).
// The offset is a page offset (meaning it is multiplied by 0x100). Only the lower 12bits of the passed value is used.
// - If block 4 ($8000-$9fff) is remapped it will point to upperPageOffset*$100 + $8000
// - If block 5 ($a000-$bfff) is remapped it will point to upperPageOffset*$100 + $a000.
// - If block 6 ($c000-$dfff) is remapped it will point to upperPageOffset*$100 + $c000.
// - If block 7 ($e000-$ffff) is remapped it will point to upperPageOffset*$100 + $e000.
// memoryRemap(byte register(Z) remapBlocks, word zp(8) lowerPageOffset, word zp($a) upperPageOffset)
memoryRemap: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
.label __1 = $c
.label __6 = $d
.label lowerPageOffset = 8
.label upperPageOffset = $a
// <lowerPageOffset
lda.z lowerPageOffset
// *aVal = <lowerPageOffset
sta aVal
// remapBlocks << 4
tza
asl
asl
asl
asl
sta.z __1
// >lowerPageOffset
lda.z lowerPageOffset+1
// >lowerPageOffset & 0xf
and #$f
// (remapBlocks << 4) | (>lowerPageOffset & 0xf)
ora.z __1
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// <upperPageOffset
lda.z upperPageOffset
// *yVal = <upperPageOffset
sta yVal
// remapBlocks & 0xf0
tza
and #$f0
sta.z __6
// >upperPageOffset
lda.z upperPageOffset+1
// >upperPageOffset & 0xf
and #$f
// (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
ora.z __6
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
// asm
lda aVal
ldx xVal
ldy yVal
ldz zVal
map
eom
// }
rts
}
.segment Data
// Array containing the banked upper memory code/data to be transferred to upper memory before execution
upperCodeData:
.segmentout [segments="Banked"]
.segment DataBanked
.pc = $4000 "MUSIC"
// SID tune at an absolute address
MUSIC:
.const music = LoadSid("Cybernoid_II_4000.sid")
.fill music.size, music.getData(i)

View File

@ -0,0 +1,81 @@
(void()) main()
main: scope:[main] from
asm { sei }
[1] call memoryRemapBlock
to:main::@1
main::@1: scope:[main] from main main::@2
[2] (byte*) main::src#2 ← phi( main::@2/(byte*) main::src#1 main/(const byte*) upperCodeData )
[2] (byte*) main::dst#2 ← phi( main::@2/(byte*) main::dst#1 main/(const byte*) MUSIC )
[3] if((byte*) main::dst#2<(const nomodify byte*) MUSIC_END) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@1
[4] call *((const void()*) musicInit)
[5] call memoryRemap
to:main::@4
main::@4: scope:[main] from main::@3 main::@7
[6] (byte*) main::mem_destroy#3 ← phi( main::@3/(const byte*) MUSIC main::@7/(byte*) main::mem_destroy#5 )
[7] *((byte*) main::mem_destroy#3) ← (byte) 0
[8] (byte*) main::mem_destroy#1 ← ++ (byte*) main::mem_destroy#3
[9] if((byte*) main::mem_destroy#1!=(const nomodify byte*) MUSIC_END) goto main::@10
to:main::@5
main::@10: scope:[main] from main::@4
[10] phi()
to:main::@5
main::@5: scope:[main] from main::@10 main::@4 main::@5
[11] (byte*) main::mem_destroy#5 ← phi( main::@10/(byte*) main::mem_destroy#1 main::@5/(byte*) main::mem_destroy#5 main::@4/(const byte*) MUSIC )
[12] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@5
to:main::@6
main::@6: scope:[main] from main::@5
[13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[14] call memoryRemapBlock
to:main::@8
main::@8: scope:[main] from main::@6
[15] call *((const void()*) musicPlay)
[16] call memoryRemap
to:main::@9
main::@9: scope:[main] from main::@8
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:main::@7
main::@7: scope:[main] from main::@7 main::@9
[18] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)==(byte) $ff) goto main::@7
to:main::@4
main::@2: scope:[main] from main::@1
[19] *((byte*) main::dst#2) ← *((byte*) main::src#2)
[20] (byte*) main::dst#1 ← ++ (byte*) main::dst#2
[21] (byte*) main::src#1 ← ++ (byte*) main::src#2
to:main::@1
(void()) memoryRemapBlock((byte) memoryRemapBlock::blockPage , (word) memoryRemapBlock::memoryPage)
memoryRemapBlock: scope:[memoryRemapBlock] from main main::@6
[22] phi()
[23] call memoryRemap
to:memoryRemapBlock::@return
memoryRemapBlock::@return: scope:[memoryRemapBlock] from memoryRemapBlock
[24] return
to:@return
(void()) memoryRemap((byte) memoryRemap::remapBlocks , (word) memoryRemap::lowerPageOffset , (word) memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main::@3 main::@8 memoryRemapBlock
[25] (word) memoryRemap::upperPageOffset#3 ← phi( main::@8/(byte) 0 main::@3/(byte) 0 memoryRemapBlock/(const word) memoryRemapBlock::pageOffset#0 )
[25] (byte) memoryRemap::remapBlocks#3 ← phi( main::@8/(byte) 0 main::@3/(byte) 0 memoryRemapBlock/(const byte) memoryRemapBlock::blockBits#0 )
[25] (word) memoryRemap::lowerPageOffset#3 ← phi( main::@8/(byte) 0 main::@3/(byte) 0 memoryRemapBlock/(const word) memoryRemapBlock::pageOffset#0 )
[26] (byte~) memoryRemap::$0 ← < (word) memoryRemap::lowerPageOffset#3
[27] *((const byte*) memoryRemap::aVal) ← (byte~) memoryRemap::$0
[28] (byte~) memoryRemap::$1 ← (byte) memoryRemap::remapBlocks#3 << (byte) 4
[29] (byte~) memoryRemap::$2 ← > (word) memoryRemap::lowerPageOffset#3
[30] (byte~) memoryRemap::$3 ← (byte~) memoryRemap::$2 & (byte) $f
[31] (byte~) memoryRemap::$4 ← (byte~) memoryRemap::$1 | (byte~) memoryRemap::$3
[32] *((const byte*) memoryRemap::xVal) ← (byte~) memoryRemap::$4
[33] (byte~) memoryRemap::$5 ← < (word) memoryRemap::upperPageOffset#3
[34] *((const byte*) memoryRemap::yVal) ← (byte~) memoryRemap::$5
[35] (byte~) memoryRemap::$6 ← (byte) memoryRemap::remapBlocks#3 & (byte) $f0
[36] (byte~) memoryRemap::$7 ← > (word) memoryRemap::upperPageOffset#3
[37] (byte~) memoryRemap::$8 ← (byte~) memoryRemap::$7 & (byte) $f
[38] (byte~) memoryRemap::$9 ← (byte~) memoryRemap::$6 | (byte~) memoryRemap::$8
[39] *((const byte*) memoryRemap::zVal) ← (byte~) memoryRemap::$9
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
[41] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,365 @@
(byte) MEGA65_VICIV::ALPHADELAY
(byte) MEGA65_VICIV::B0PIX
(byte) MEGA65_VICIV::B0_ADDR
(byte) MEGA65_VICIV::B1PIX
(byte) MEGA65_VICIV::B1_ADDR
(byte) MEGA65_VICIV::B2PIX
(byte) MEGA65_VICIV::B2_ADDR
(byte) MEGA65_VICIV::B3PIX
(byte) MEGA65_VICIV::B3_ADDR
(byte) MEGA65_VICIV::B4PIX
(byte) MEGA65_VICIV::B4_ADDR
(byte) MEGA65_VICIV::B5PIX
(byte) MEGA65_VICIV::B5_ADDR
(byte) MEGA65_VICIV::B6PIX
(byte) MEGA65_VICIV::B6_ADDR
(byte) MEGA65_VICIV::B7PIX
(byte) MEGA65_VICIV::B7_ADDR
(byte) MEGA65_VICIV::BBDRPOS_HI
(byte) MEGA65_VICIV::BBDRPOS_LO
(byte) MEGA65_VICIV::BG_COLOR
(byte) MEGA65_VICIV::BG_COLOR1
(byte) MEGA65_VICIV::BG_COLOR2
(byte) MEGA65_VICIV::BG_COLOR3
(byte) MEGA65_VICIV::BORDER_COLOR
(byte) MEGA65_VICIV::BP16ENS
(byte) MEGA65_VICIV::BPCOMP
(byte) MEGA65_VICIV::BPX
(byte) MEGA65_VICIV::BPY
(byte) MEGA65_VICIV::CHARPTR_HILO
(byte) MEGA65_VICIV::CHARPTR_LOHI
(byte) MEGA65_VICIV::CHARPTR_LOLO
(byte) MEGA65_VICIV::CHARSTEP_HI
(byte) MEGA65_VICIV::CHARSTEP_LO
(byte) MEGA65_VICIV::CHRCOUNT
(byte) MEGA65_VICIV::CHRXSCL
(byte) MEGA65_VICIV::CHRYSCL
(byte) MEGA65_VICIV::COLPTR_HI
(byte) MEGA65_VICIV::COLPTR_LO
(byte) MEGA65_VICIV::CONTROL1
(byte) MEGA65_VICIV::CONTROL2
(byte) MEGA65_VICIV::CONTROLA
(byte) MEGA65_VICIV::CONTROLB
(byte) MEGA65_VICIV::CONTROLC
(byte) MEGA65_VICIV::DEBUG1
(byte) MEGA65_VICIV::DEBUGX
(byte) MEGA65_VICIV::DEBUGXY
(byte) MEGA65_VICIV::DEBUGY
(byte) MEGA65_VICIV::FNRASTER_HI
(byte) MEGA65_VICIV::FNRASTER_LO
(byte) MEGA65_VICIV::HPOS
(byte) MEGA65_VICIV::IRQ_ENABLE
(byte) MEGA65_VICIV::IRQ_STATUS
(byte) MEGA65_VICIV::KEY
(byte) MEGA65_VICIV::LIGHTPEN_X
(byte) MEGA65_VICIV::LIGHTPEN_Y
(byte) MEGA65_VICIV::MEMORY
(byte) MEGA65_VICIV::PALSEL
(byte) MEGA65_VICIV::RASLINE0
(byte) MEGA65_VICIV::RASTER
(byte) MEGA65_VICIV::ROWCOUNT
(byte) MEGA65_VICIV::RSTCMP
(byte) MEGA65_VICIV::RSTCOMP
(byte) MEGA65_VICIV::SBPDEBUG
(byte) MEGA65_VICIV::SCRNPTR_HIHI
(byte) MEGA65_VICIV::SCRNPTR_HILO
(byte) MEGA65_VICIV::SCRNPTR_LOHI
(byte) MEGA65_VICIV::SCRNPTR_LOLO
(byte) MEGA65_VICIV::SIDBDRWD_HI
(byte) MEGA65_VICIV::SIDBDRWD_LO
(byte) MEGA65_VICIV::SPR16EN
(byte) MEGA65_VICIV::SPRALPHAVAL
(byte) MEGA65_VICIV::SPRENALPHA
(byte) MEGA65_VICIV::SPRENV400
(byte) MEGA65_VICIV::SPRHGHT
(byte) MEGA65_VICIV::SPRHGTEN
(byte) MEGA65_VICIV::SPRITE0_COLOR
(byte) MEGA65_VICIV::SPRITE0_X
(byte) MEGA65_VICIV::SPRITE0_Y
(byte) MEGA65_VICIV::SPRITE1_COLOR
(byte) MEGA65_VICIV::SPRITE1_X
(byte) MEGA65_VICIV::SPRITE1_Y
(byte) MEGA65_VICIV::SPRITE2_COLOR
(byte) MEGA65_VICIV::SPRITE2_X
(byte) MEGA65_VICIV::SPRITE2_Y
(byte) MEGA65_VICIV::SPRITE3_COLOR
(byte) MEGA65_VICIV::SPRITE3_X
(byte) MEGA65_VICIV::SPRITE3_Y
(byte) MEGA65_VICIV::SPRITE4_COLOR
(byte) MEGA65_VICIV::SPRITE4_X
(byte) MEGA65_VICIV::SPRITE4_Y
(byte) MEGA65_VICIV::SPRITE5_COLOR
(byte) MEGA65_VICIV::SPRITE5_X
(byte) MEGA65_VICIV::SPRITE5_Y
(byte) MEGA65_VICIV::SPRITE6_COLOR
(byte) MEGA65_VICIV::SPRITE6_X
(byte) MEGA65_VICIV::SPRITE6_Y
(byte) MEGA65_VICIV::SPRITE7_COLOR
(byte) MEGA65_VICIV::SPRITE7_X
(byte) MEGA65_VICIV::SPRITE7_Y
(byte) MEGA65_VICIV::SPRITES_BG_COLLISION
(byte) MEGA65_VICIV::SPRITES_COLLISION
(byte) MEGA65_VICIV::SPRITES_ENABLE
(byte) MEGA65_VICIV::SPRITES_EXPAND_X
(byte) MEGA65_VICIV::SPRITES_EXPAND_Y
(byte) MEGA65_VICIV::SPRITES_MC
(byte) MEGA65_VICIV::SPRITES_MCOLOR1
(byte) MEGA65_VICIV::SPRITES_MCOLOR2
(byte) MEGA65_VICIV::SPRITES_PRIORITY
(byte) MEGA65_VICIV::SPRITES_XMSB
(byte) MEGA65_VICIV::SPRPTRADR_HILO
(byte) MEGA65_VICIV::SPRPTRADR_LOHI
(byte) MEGA65_VICIV::SPRPTRADR_LOLO
(byte) MEGA65_VICIV::SPRX64EN
(byte) MEGA65_VICIV::SPRXSMSBS
(byte) MEGA65_VICIV::SPRYSMSBSM
(byte) MEGA65_VICIV::SRPYMSBS
(byte) MEGA65_VICIV::SYNCPOL
(byte) MEGA65_VICIV::TBDRPOS_HI
(byte) MEGA65_VICIV::TBDRPOS_LO
(byte) MEGA65_VICIV::TEXTXPOS_HI
(byte) MEGA65_VICIV::TEXTXPOS_LO
(byte) MEGA65_VICIV::TEXTYPOS_HI
(byte) MEGA65_VICIV::TEXTYPOS_LO
(byte) MEGA65_VICIV::UNUSED
(byte) MEGA65_VICIV::VPOS
(byte) MEGA65_VICIV::VSYNDEL
(byte) MEGA65_VICIV::XPOS_HI
(byte) MEGA65_VICIV::XPOS_LO
(byte) MOS4569_VICIII::B0PIX
(byte) MOS4569_VICIII::B0_ADDR
(byte) MOS4569_VICIII::B1PIX
(byte) MOS4569_VICIII::B1_ADDR
(byte) MOS4569_VICIII::B2PIX
(byte) MOS4569_VICIII::B2_ADDR
(byte) MOS4569_VICIII::B3PIX
(byte) MOS4569_VICIII::B3_ADDR
(byte) MOS4569_VICIII::B4PIX
(byte) MOS4569_VICIII::B4_ADDR
(byte) MOS4569_VICIII::B5PIX
(byte) MOS4569_VICIII::B5_ADDR
(byte) MOS4569_VICIII::B6PIX
(byte) MOS4569_VICIII::B6_ADDR
(byte) MOS4569_VICIII::B7PIX
(byte) MOS4569_VICIII::B7_ADDR
(byte) MOS4569_VICIII::BG_COLOR
(byte) MOS4569_VICIII::BG_COLOR1
(byte) MOS4569_VICIII::BG_COLOR2
(byte) MOS4569_VICIII::BG_COLOR3
(byte) MOS4569_VICIII::BORDER_COLOR
(byte) MOS4569_VICIII::BPCOMP
(byte) MOS4569_VICIII::BPX
(byte) MOS4569_VICIII::BPY
(byte) MOS4569_VICIII::CONTROL1
(byte) MOS4569_VICIII::CONTROL2
(byte) MOS4569_VICIII::CONTROLA
(byte) MOS4569_VICIII::CONTROLB
(byte) MOS4569_VICIII::HPOS
(byte) MOS4569_VICIII::IRQ_ENABLE
(byte) MOS4569_VICIII::IRQ_STATUS
(byte) MOS4569_VICIII::KEY
(byte) MOS4569_VICIII::LIGHTPEN_X
(byte) MOS4569_VICIII::LIGHTPEN_Y
(byte) MOS4569_VICIII::MEMORY
(byte) MOS4569_VICIII::RASTER
(byte) MOS4569_VICIII::SPRITE0_COLOR
(byte) MOS4569_VICIII::SPRITE0_X
(byte) MOS4569_VICIII::SPRITE0_Y
(byte) MOS4569_VICIII::SPRITE1_COLOR
(byte) MOS4569_VICIII::SPRITE1_X
(byte) MOS4569_VICIII::SPRITE1_Y
(byte) MOS4569_VICIII::SPRITE2_COLOR
(byte) MOS4569_VICIII::SPRITE2_X
(byte) MOS4569_VICIII::SPRITE2_Y
(byte) MOS4569_VICIII::SPRITE3_COLOR
(byte) MOS4569_VICIII::SPRITE3_X
(byte) MOS4569_VICIII::SPRITE3_Y
(byte) MOS4569_VICIII::SPRITE4_COLOR
(byte) MOS4569_VICIII::SPRITE4_X
(byte) MOS4569_VICIII::SPRITE4_Y
(byte) MOS4569_VICIII::SPRITE5_COLOR
(byte) MOS4569_VICIII::SPRITE5_X
(byte) MOS4569_VICIII::SPRITE5_Y
(byte) MOS4569_VICIII::SPRITE6_COLOR
(byte) MOS4569_VICIII::SPRITE6_X
(byte) MOS4569_VICIII::SPRITE6_Y
(byte) MOS4569_VICIII::SPRITE7_COLOR
(byte) MOS4569_VICIII::SPRITE7_X
(byte) MOS4569_VICIII::SPRITE7_Y
(byte) MOS4569_VICIII::SPRITES_BG_COLLISION
(byte) MOS4569_VICIII::SPRITES_COLLISION
(byte) MOS4569_VICIII::SPRITES_ENABLE
(byte) MOS4569_VICIII::SPRITES_EXPAND_X
(byte) MOS4569_VICIII::SPRITES_EXPAND_Y
(byte) MOS4569_VICIII::SPRITES_MC
(byte) MOS4569_VICIII::SPRITES_MCOLOR1
(byte) MOS4569_VICIII::SPRITES_MCOLOR2
(byte) MOS4569_VICIII::SPRITES_PRIORITY
(byte) MOS4569_VICIII::SPRITES_XMSB
(byte) MOS4569_VICIII::UNUSED
(byte) MOS4569_VICIII::VPOS
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte*) MUSIC[] = kickasm {{ .const music = LoadSid("Cybernoid_II_4000.sid")
.fill music.size, music.getData(i)
}}
(const nomodify byte*) MUSIC_END = (byte*) 20992
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@1
(label) main::@10
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(label) main::@9
(byte*) main::dst
(byte*) main::dst#1 dst zp[2]:2 11.0
(byte*) main::dst#2 dst zp[2]:2 14.666666666666666
(byte*) main::mem_destroy
(byte*) main::mem_destroy#1 mem_destroy zp[2]:6 11.0
(byte*) main::mem_destroy#3 mem_destroy zp[2]:6 61.5
(byte*) main::mem_destroy#5 mem_destroy zp[2]:6 39.25
(byte*) main::src
(byte*) main::src#1 src zp[2]:4 22.0
(byte*) main::src#2 src zp[2]:4 8.25
(void()) memoryRemap((byte) memoryRemap::remapBlocks , (word) memoryRemap::lowerPageOffset , (word) memoryRemap::upperPageOffset)
(byte~) memoryRemap::$0 reg byte a 2002.0
(byte~) memoryRemap::$1 zp[1]:12 667.3333333333334
(byte~) memoryRemap::$2 reg byte a 2002.0
(byte~) memoryRemap::$3 reg byte a 2002.0
(byte~) memoryRemap::$4 reg byte a 2002.0
(byte~) memoryRemap::$5 reg byte a 2002.0
(byte~) memoryRemap::$6 zp[1]:13 667.3333333333334
(byte~) memoryRemap::$7 reg byte a 2002.0
(byte~) memoryRemap::$8 reg byte a 2002.0
(byte~) memoryRemap::$9 reg byte a 2002.0
(label) memoryRemap::@return
(const byte*) memoryRemap::aVal = (byte*) 252
(word) memoryRemap::lowerPageOffset
(word) memoryRemap::lowerPageOffset#3 lowerPageOffset zp[2]:8 500.5
(byte) memoryRemap::remapBlocks
(byte) memoryRemap::remapBlocks#3 reg byte z 200.2
(word) memoryRemap::upperPageOffset
(word) memoryRemap::upperPageOffset#3 upperPageOffset zp[2]:10 182.0
(const byte*) memoryRemap::xVal = (byte*) 253
(const byte*) memoryRemap::yVal = (byte*) 254
(const byte*) memoryRemap::zVal = (byte*) 255
(void()) memoryRemapBlock((byte) memoryRemapBlock::blockPage , (word) memoryRemapBlock::memoryPage)
(label) memoryRemapBlock::@return
(byte) memoryRemapBlock::block
(const byte) memoryRemapBlock::block#0 block = (byte) $40>>(byte) 5
(byte) memoryRemapBlock::blockBits
(const byte) memoryRemapBlock::blockBits#0 blockBits = (byte) 1<<(const byte) memoryRemapBlock::block#0
(byte) memoryRemapBlock::blockPage
(word) memoryRemapBlock::memoryPage
(word) memoryRemapBlock::pageOffset
(const word) memoryRemapBlock::pageOffset#0 pageOffset = (word) $100-(byte) $40
(const void()*) musicInit = (void()*)(const byte*) MUSIC
(const void()*) musicPlay = (void()*)(const byte*) MUSIC+(byte) 3
(const byte*) upperCodeData[] = kickasm {{ .segmentout [segments="Banked"]
}}
zp[2]:2 [ main::dst#2 main::dst#1 ]
zp[2]:4 [ main::src#2 main::src#1 ]
zp[2]:6 [ main::mem_destroy#3 main::mem_destroy#5 main::mem_destroy#1 ]
zp[2]:8 [ memoryRemap::lowerPageOffset#3 ]
reg byte z [ memoryRemap::remapBlocks#3 ]
zp[2]:10 [ memoryRemap::upperPageOffset#3 ]
reg byte a [ memoryRemap::$0 ]
zp[1]:12 [ memoryRemap::$1 ]
reg byte a [ memoryRemap::$2 ]
reg byte a [ memoryRemap::$3 ]
reg byte a [ memoryRemap::$4 ]
reg byte a [ memoryRemap::$5 ]
zp[1]:13 [ memoryRemap::$6 ]
reg byte a [ memoryRemap::$7 ]
reg byte a [ memoryRemap::$8 ]
reg byte a [ memoryRemap::$9 ]