1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-11 20:30:08 +00:00

Added first simple MEGA65 library function.

This commit is contained in:
jespergravgaard 2020-09-26 08:57:29 +02:00
parent 18bce95623
commit 6e206d25a3
14 changed files with 4932 additions and 225 deletions

View File

@ -20,6 +20,9 @@ lda {z1}
cmp #<{c1}
bcc {la1}
!:
//FRAGMENT _deref_pbuc1=_deref_pbuc2
lda {c2}
sta {c1}
//FRAGMENT vbuz1=_lo_pbuz2
lda {z2}
sta {z1}
@ -1275,44 +1278,11 @@ cpz #{c1}
bne {la1}
//FRAGMENT vbuaa=vbuzz
tza
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1
lda #{c1}
ldy {z1}
cmp {c2},y
bne {la1}
//FRAGMENT pbuc1_derefidx_vbuz1=vbuz1
ldy {z1}
tya
sta {c1},y
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuaa_then_la1
tay
lda #{c1}
cmp {c2},y
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
lda {c2},x
cmp #{c1}
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1
lda #{c1}
cmp {c2},y
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuzz_then_la1
tza
tay
lda #{c1}
cmp {c2},y
bne {la1}
//FRAGMENT pbuc1_derefidx_vbuxx=vbuxx
txa
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuyy=vbuyy
tya
sta {c1},y
//FRAGMENT pbuc1_derefidx_vbuzz=vbuzz
tza
tax
sta {c1},x
//FRAGMENT vwuz1=vbuc1
lda #<{c1}
sta {z1}
lda #>{c1}
sta {z1}+1
//FRAGMENT vduz1=vduc1
lda #<{c1}
sta {z1}
@ -1322,40 +1292,6 @@ lda #<{c1}>>$10
sta {z1}+2
lda #>{c1}>>$10
sta {z1}+3
//FRAGMENT _deref_pduc1=vduz1
ldq {z1}
stq {c1}
//FRAGMENT vduz1=vduz1_plus_vduz2
clc
ldq {z1}
adcq {z2}
stq {z1}
//FRAGMENT vduz1=vduz1_plus_vbuz2
lda {z2}
clc
adc {z1}
sta {z1}
lda {z1}+1
adc #0
sta {z1}+1
lda {z1}+2
adc #0
sta {z1}+2
lda {z1}+3
adc #0
sta {z1}+3
//FRAGMENT vduz1=vwuc1
NO_SYNTHESIS
//FRAGMENT vduz1=vwsc1
NO_SYNTHESIS
//FRAGMENT vwuz1=vbuc1
lda #<{c1}
sta {z1}
lda #>{c1}
sta {z1}+1
//FRAGMENT _deref_pbuc1=_deref_pbuc2
lda {c2}
sta {c1}
//FRAGMENT vduz1=vbuc1
lda #{c1}
sta {z1}
@ -2237,23 +2173,77 @@ tax
tay
//FRAGMENT vbuzz=vbuaa
taz
//FRAGMENT _deref_pbuc1_neq_vbuc2_then_la1
lda #{c2}
cmp {c1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuz1_then_la1
lda #{c1}
ldy {z1}
cmp {c2},y
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}
//FRAGMENT pbuc1_derefidx_vbuz1=vbuz1
ldy {z1}
tya
sta {c1},y
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuaa_then_la1
tay
lda #{c1}
cmp {c2},y
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuxx_then_la1
lda {c2},x
cmp #{c1}
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuyy_then_la1
lda #{c1}
cmp {c2},y
bne {la1}
//FRAGMENT vbuc1_neq_pbuc2_derefidx_vbuzz_then_la1
tza
tay
lda #{c1}
cmp {c2},y
bne {la1}
//FRAGMENT pbuc1_derefidx_vbuxx=vbuxx
txa
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuyy=vbuyy
tya
sta {c1},y
//FRAGMENT pbuc1_derefidx_vbuzz=vbuzz
tza
tax
sta {c1},x
//FRAGMENT _deref_pduc1=vduz1
ldq {z1}
stq {c1}
//FRAGMENT vduz1=vduz1_plus_vduz2
clc
ldq {z1}
adcq {z2}
stq {z1}
//FRAGMENT vduz1=vduz1_plus_vbuz2
lda {z2}
clc
adc {z1}
sta {z1}
lda #>{c1}
lda {z1}+1
adc #0
sta {z1}+1
//FRAGMENT pbuc1_derefidx_vbuz1=_inc_pbuc1_derefidx_vbuz1
ldx {z1}
inc {c1},x
lda {z1}+2
adc #0
sta {z1}+2
lda {z1}+3
adc #0
sta {z1}+3
//FRAGMENT vduz1=vwuc1
NO_SYNTHESIS
//FRAGMENT vduz1=vwsc1
NO_SYNTHESIS
//FRAGMENT _deref_pwuc1=vwuc2
lda #<{c2}
sta {c1}
lda #>{c2}
sta {c1}+1
//FRAGMENT _deref_qbuc1=pbuc2
lda #<{c2}
sta {c1}
lda #>{c2}
sta {c1}+1

View File

@ -1,135 +1,38 @@
// MEGA65 DMA
// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
// C65 Manual http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt
// DMA lists https://raw.githubusercontent.com/MEGA65/c65-specifications/master/c65manualupdated.txt
// DMA lists https://c65gs.blogspot.com/2019/03/auto-detecting-required-revision-of.html
// DMA list options https://c65gs.blogspot.com/2018/01/improving-dmagic-controller-interface.html
// DMAgic VHDL source https://github.com/MEGA65/mega65-core/blob/master/src/vhdl/gs4510.vhdl#L4364
// Xemu emulator source https://github.com/lgblgblgb/xemu/blob/master/xemu/f018_core.c
// Functions for using the F018 DMA for very fast copying or filling of memory
#include <mega65.h>
// Registers of the MEGA65 enchanced F018 DMAgic Controller
struct F018_DMAGIC {
// $D700 ADDRLSBTRIG DMAgic DMA list address LSB, and trigger DMA (when written).
// We also clear out the upper address bits in case an enhanced job had set them.
char ADDRLSBTRIG;
// $D701 ADDRMSB DMA list address high byte (address bits 8 -- 15).
char ADDRMSB;
// $D702 ADDRBANK DMA list address bank (address bits 16 -- 22). Writing clears $D704.
char ADDRBANK;
// $D703 EN018B DMA enable F018B mode (adds sub-command byte )
// bit 0 enable F018B mode.
char EN018B;
// $D704 ADDRMB DMA list address mega-byte
char ADDRMB;
// $D705 ETRIG Set low-order byte of DMA list address, and trigger Enhanced DMA job
// Works like $D700, but enables DMA option lists.
char ETRIG;
// $D706-$D70D Unused
char UNUSED1[8];
// $D70E ADDRLSB DMA list address low byte (address bits 0 -- 7) WITHOUT STARTING A DMA JOB
// (used by Hypervisor for unfreezing DMA-using tasks)
char ADDRLSB;
// $D70F Unused
char UNUSED2;
// $D710 MISC (non-DMA) options
// $D710.0 - MISC:BADLEN Enable badline emulation
// $D710.1 - MISC:SLIEN Enable 6502-style slow (7 cycle) interrupts
// $D710.2 - MISC:VDCSEN Enable VDC interface simulation
char MISC;
};
// Copy a memory block within the first 64K memory space using MEGA65 DMagic DMA
// Copies the values of num bytes from the location pointed to by source directly
// to the memory block pointed to by destination.
// The underlying type of the objects pointed to by both the source and destination pointers
// are irrelevant for this function; The result is a binary copy of the data.
void memcpy_dma(void* dest, void* src, unsigned int num) {
// Remember current F018 A/B mode
char dmaMode = DMA->EN018B;
// Set up command
memcpy_dma_command.count = num;
memcpy_dma_command.src = src;
memcpy_dma_command.dest = dest;
// Set F018B mode
DMA->EN018B = 1;
// Set address of DMA list
DMA->ADDRMB = 0;
DMA->ADDRBANK = 0;
DMA-> ADDRMSB = >&memcpy_dma_command;
// Trigger the DMA (without option lists)
DMA-> ADDRLSBTRIG = <&memcpy_dma_command;
// Re-enable F018A mode
DMA->EN018B = dmaMode;
}
// F018A DMA list entry
struct DMA_LIST_F018A {
// DMA command
// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
// 2 chain
// 3 allow interrupt (unsupported)
char command;
// Count of bytes to copy/fill
unsigned int count;
// Source address (low byte is used as data for command fill)
char* src;
// Source address bank
// bits
// 7 src I/O
// 6 src direction
// 5 src modulo
// 4 src hold
// 0-3 address bank
char src_bank;
// Destination address
char* dest;
// Destination address bank
// bits
// 7 dest I/O
// 6 dest direction
// 5 dest modulo
// 4 dest hold
// 0-3 address bank
char dest_bank;
// Modulo value (unused)
unsigned int modulo;
};
// F018B DMA list entry
struct DMA_LIST_F018B {
// DMA command (format F018B)
// bits
// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
// 2 chain
// 3 allow interrupt (unsupported)
// 4 src direction
// 5 dest direction
char command;
// Count of bytes to copy/fill
unsigned int count;
// Source address (low byte is used as data for command fill)
char* src;
// Source address bank
// bits
// 7 src I/O
// 0-6 dest address bank
char src_bank;
// Destination address
char* dest;
// Destination address bank
// bits
// 7 dest I/O
// 0-6 dest address bank
char dest_bank;
// Sub-command
// bits
// 0 src modulo (unsupported)
// 1 src hold
// 2 dest modulo (unsupported)
// 3 dest hold
char sub_command;
// Modulo value (unused)
unsigned int modulo;
};
// DMA command copy
const char DMA_COMMAND_COPY = 0x00;
// DMA command fill
const char DMA_COMMAND_FILL = 0x03;
// DMA command fill
const char DMA_COMMAND_CHAIN = 0x04;
// DMA command source direction
const char DMA_COMMAND_SRC_DIR = 0x10;
// DMA command destination direction
const char DMA_COMMAND_DEST_DIR = 0x20;
// Extended DMA Option Prefixes
// $00 = End of options
// $06 = Use $86 $xx transparency value (don't write source bytes to destination, if byte value matches $xx)
// $07 = Disable $86 $xx transparency value.
// $0A = Use F018A list format
// $0B = Use F018B list format
// $80 $xx = Set MB of source address
// $81 $xx = Set MB of destination address
// $82 $xx = Set source skip rate (/256ths of bytes)
// $83 $xx = Set source skip rate (whole bytes)
// $84 $xx = Set destination skip rate (/256ths of bytes)
// $85 $xx = Set destination skip rate (whole bytes)
// $86 $xx = Don't write to destination if byte value = $xx, and option $06 enabled
// DMA list entry for copying data
struct DMA_LIST_F018B memcpy_dma_command = {
DMA_COMMAND_COPY, // command
0, // count
0, // source
0, // source bank
0, // destination
0, // destination bank
0, // sub-command
0 // modulo-value
};

View File

@ -0,0 +1,135 @@
// MEGA65 DMA
// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
// C65 Manual http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt
// DMA lists https://raw.githubusercontent.com/MEGA65/c65-specifications/master/c65manualupdated.txt
// DMA lists https://c65gs.blogspot.com/2019/03/auto-detecting-required-revision-of.html
// DMA list options https://c65gs.blogspot.com/2018/01/improving-dmagic-controller-interface.html
// DMAgic VHDL source https://github.com/MEGA65/mega65-core/blob/master/src/vhdl/gs4510.vhdl#L4364
// Xemu emulator source https://github.com/lgblgblgb/xemu/blob/master/xemu/f018_core.c
// Registers of the MEGA65 enchanced F018 DMAgic Controller
struct F018_DMAGIC {
// $D700 ADDRLSBTRIG DMAgic DMA list address LSB, and trigger DMA (when written).
// We also clear out the upper address bits in case an enhanced job had set them.
char ADDRLSBTRIG;
// $D701 ADDRMSB DMA list address high byte (address bits 8 -- 15).
char ADDRMSB;
// $D702 ADDRBANK DMA list address bank (address bits 16 -- 22). Writing clears $D704.
char ADDRBANK;
// $D703 EN018B DMA enable F018B mode (adds sub-command byte )
// bit 0 enable F018B mode.
char EN018B;
// $D704 ADDRMB DMA list address mega-byte
char ADDRMB;
// $D705 ETRIG Set low-order byte of DMA list address, and trigger Enhanced DMA job
// Works like $D700, but enables DMA option lists.
char ETRIG;
// $D706-$D70D Unused
char UNUSED1[8];
// $D70E ADDRLSB DMA list address low byte (address bits 0 -- 7) WITHOUT STARTING A DMA JOB
// (used by Hypervisor for unfreezing DMA-using tasks)
char ADDRLSB;
// $D70F Unused
char UNUSED2;
// $D710 MISC (non-DMA) options
// $D710.0 - MISC:BADLEN Enable badline emulation
// $D710.1 - MISC:SLIEN Enable 6502-style slow (7 cycle) interrupts
// $D710.2 - MISC:VDCSEN Enable VDC interface simulation
char MISC;
};
// F018A DMA list entry
struct DMA_LIST_F018A {
// DMA command
// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
// 2 chain
// 3 allow interrupt (unsupported)
char command;
// Count of bytes to copy/fill
unsigned int count;
// Source address (low byte is used as data for command fill)
char* src;
// Source address bank
// bits
// 7 src I/O
// 6 src direction
// 5 src modulo
// 4 src hold
// 0-3 address bank
char src_bank;
// Destination address
char* dest;
// Destination address bank
// bits
// 7 dest I/O
// 6 dest direction
// 5 dest modulo
// 4 dest hold
// 0-3 address bank
char dest_bank;
// Modulo value (unused)
unsigned int modulo;
};
// F018B DMA list entry
struct DMA_LIST_F018B {
// DMA command (format F018B)
// bits
// 0-1 command (00: copy, 01: mix (unsupported) 10: swap (unsupported) 11: fill )
// 2 chain
// 3 allow interrupt (unsupported)
// 4 src direction
// 5 dest direction
char command;
// Count of bytes to copy/fill
unsigned int count;
// Source address (low byte is used as data for command fill)
char* src;
// Source address bank
// bits
// 7 src I/O
// 0-6 dest address bank
char src_bank;
// Destination address
char* dest;
// Destination address bank
// bits
// 7 dest I/O
// 0-6 dest address bank
char dest_bank;
// Sub-command
// bits
// 0 src modulo (unsupported)
// 1 src hold
// 2 dest modulo (unsupported)
// 3 dest hold
char sub_command;
// Modulo value (unused)
unsigned int modulo;
};
// DMA command copy
const char DMA_COMMAND_COPY = 0x00;
// DMA command fill
const char DMA_COMMAND_FILL = 0x03;
// DMA command fill
const char DMA_COMMAND_CHAIN = 0x04;
// DMA command source direction
const char DMA_COMMAND_SRC_DIR = 0x10;
// DMA command destination direction
const char DMA_COMMAND_DEST_DIR = 0x20;
// Extended DMA Option Prefixes
// $00 = End of options
// $06 = Use $86 $xx transparency value (don't write source bytes to destination, if byte value matches $xx)
// $07 = Disable $86 $xx transparency value.
// $0A = Use F018A list format
// $0B = Use F018B list format
// $80 $xx = Set MB of source address
// $81 $xx = Set MB of destination address
// $82 $xx = Set source skip rate (/256ths of bytes)
// $83 $xx = Set source skip rate (whole bytes)
// $84 $xx = Set destination skip rate (/256ths of bytes)
// $85 $xx = Set destination skip rate (whole bytes)
// $86 $xx = Don't write to destination if byte value = $xx, and option $06 enabled

View File

@ -8,7 +8,7 @@
#include <mos4569.h>
#include <mega65-viciv.h>
#include <mega65-memorymapper.h>
#include <mega65-dma.h>
#include <mega65-f018.h>
// I/O Personality selection
volatile char * const IO_KEY = 0xd02f;

View File

@ -238,8 +238,13 @@ public class TestPrograms {
}
@Test
public void testMega65BankedMusic() throws IOException, URISyntaxException {
compileAndCompare("examples/mega65/banked-music.c");
public void testMega65DmaTest2() throws IOException, URISyntaxException {
compileAndCompare("examples/mega65/dma-test2.c");
}
@Test
public void testMega65DmaTest() throws IOException, URISyntaxException {
compileAndCompare("examples/mega65/dma-test.c");
}
@Test

View File

@ -0,0 +1,11 @@
// MEGA65 DMA test
// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
#pragma target(mega65)
#include <mega65-dma.h>
void main() {
// Map memory to BANK 0 : 0x00XXXX - giving access to I/O
memoryRemap(0,0,0);
// Move screen up using DMA
memcpy_dma(DEFAULT_SCREEN, DEFAULT_SCREEN+80, 24*80);
}

View File

@ -0,0 +1,112 @@
// MEGA65 DMA test
// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
// MEGA65 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.cpu _45gs02
// MEGA65 platform PRG executable starting in MEGA65 mode.
.file [name="dma-test.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$2001]
.segmentdef Code [start=$2017]
.segmentdef Data [startAfter="Code"]
.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 //
// DMA command copy
.const DMA_COMMAND_COPY = 0
.const OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
.const OFFSET_STRUCT_F018_DMAGIC_ADDRMB = 4
.const OFFSET_STRUCT_F018_DMAGIC_ADDRBANK = 2
.const OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
// DMAgic F018 Controller
.label DMA = $d700
// Default address of screen character matrix
.label DEFAULT_SCREEN = $800
.segment Code
main: {
// memoryRemap(0,0,0)
// Map memory to BANK 0 : 0x00XXXX - giving access to I/O
jsr memoryRemap
// DMA->EN018B = 1
// Enable enable F018B mode
lda #1
sta DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// DMA->ADDRMB = 0
// Set address of DMA list
lda #0
sta DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB
// DMA->ADDRBANK = 0
sta DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK
// DMA-> ADDRMSB = >&DMA_SCREEN_UP
lda #>DMA_SCREEN_UP
sta DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB
// DMA-> ADDRLSBTRIG = <&DMA_SCREEN_UP
// Trigger the DMA (without option lists)
lda #<DMA_SCREEN_UP
sta DMA
// DMA->EN018B = 0
// Re-enable F018A mode
lda #0
sta DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// }
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: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
// asm
lda aVal
ldx xVal
ldy yVal
ldz zVal
map
eom
// }
rts
}
.segment Data
// DMA list entry that scrolls the default screen up
DMA_SCREEN_UP: .byte DMA_COMMAND_COPY
.word $18*$50, DEFAULT_SCREEN+$50
.byte 0
.word DEFAULT_SCREEN
.byte 0, 0
.word 0

View File

@ -0,0 +1,29 @@
(void()) main()
main: scope:[main] from
[0] phi()
[1] call memoryRemap
to:main::@1
main::@1: scope:[main] from main
[2] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B) ← (byte) 1
[3] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMB) ← (byte) 0
[4] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) ← (byte) 0
[5] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) ← >&(struct DMA_LIST_F018B) DMA_SCREEN_UP
[6] *((byte*)(const nomodify struct F018_DMAGIC*) DMA) ← <&(struct DMA_LIST_F018B) DMA_SCREEN_UP
[7] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B) ← (byte) 0
to:main::@return
main::@return: scope:[main] from main::@1
[8] return
to:@return
(void()) memoryRemap((byte) memoryRemap::remapBlocks , (word) memoryRemap::lowerPageOffset , (word) memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[9] *((const byte*) memoryRemap::aVal) ← (byte) 0
[10] *((const byte*) memoryRemap::xVal) ← (byte) 0
[11] *((const byte*) memoryRemap::yVal) ← (byte) 0
[12] *((const byte*) memoryRemap::zVal) ← (byte) 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
[14] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,331 @@
(const nomodify byte*) DEFAULT_SCREEN = (byte*) 2048
(const nomodify struct F018_DMAGIC*) DMA = (struct F018_DMAGIC*) 55040
(const nomodify byte) DMA_COMMAND_COPY = (byte) 0
(byte) DMA_LIST_F018A::command
(word) DMA_LIST_F018A::count
(byte*) DMA_LIST_F018A::dest
(byte) DMA_LIST_F018A::dest_bank
(word) DMA_LIST_F018A::modulo
(byte*) DMA_LIST_F018A::src
(byte) DMA_LIST_F018A::src_bank
(byte) DMA_LIST_F018B::command
(word) DMA_LIST_F018B::count
(byte*) DMA_LIST_F018B::dest
(byte) DMA_LIST_F018B::dest_bank
(word) DMA_LIST_F018B::modulo
(byte*) DMA_LIST_F018B::src
(byte) DMA_LIST_F018B::src_bank
(byte) DMA_LIST_F018B::sub_command
(struct DMA_LIST_F018B) DMA_SCREEN_UP loadstore mem[12] = { command: (const nomodify byte) DMA_COMMAND_COPY, count: (word)(number) $18*(number) $50, src: (const nomodify byte*) DEFAULT_SCREEN+(byte) $50, src_bank: (byte) 0, dest: (const nomodify byte*) DEFAULT_SCREEN, dest_bank: (byte) 0, sub_command: (byte) 0, modulo: (word) 0 }
(byte) F018_DMAGIC::ADDRBANK
(byte) F018_DMAGIC::ADDRLSB
(byte) F018_DMAGIC::ADDRLSBTRIG
(byte) F018_DMAGIC::ADDRMB
(byte) F018_DMAGIC::ADDRMSB
(byte) F018_DMAGIC::EN018B
(byte) F018_DMAGIC::ETRIG
(byte) F018_DMAGIC::MISC
(const byte*) F018_DMAGIC::UNUSED1[(number) 8] = { fill( 8, 0) }
(byte) F018_DMAGIC::UNUSED2
(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) OFFSET_STRUCT_F018_DMAGIC_ADDRBANK = (byte) 2
(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMB = (byte) 4
(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = (byte) 1
(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B = (byte) 3
(void()) main()
(label) main::@1
(label) main::@return
(void()) memoryRemap((byte) memoryRemap::remapBlocks , (word) memoryRemap::lowerPageOffset , (word) memoryRemap::upperPageOffset)
(label) memoryRemap::@return
(const byte*) memoryRemap::aVal = (byte*) 252
(word) memoryRemap::lowerPageOffset
(byte) memoryRemap::remapBlocks
(word) memoryRemap::upperPageOffset
(const byte*) memoryRemap::xVal = (byte*) 253
(const byte*) memoryRemap::yVal = (byte*) 254
(const byte*) memoryRemap::zVal = (byte*) 255
mem[12] [ DMA_SCREEN_UP ]

View File

@ -0,0 +1,149 @@
// MEGA65 DMA test
// Appendix J in https://mega.scryptos.com/sharefolder-link/MEGA/MEGA65+filehost/Docs/MEGA65-Book_draft.pdf
// Functions for using the F018 DMA for very fast copying or filling of memory
// MEGA65 Registers and Constants
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
.cpu _45gs02
// MEGA65 platform PRG executable starting in MEGA65 mode.
.file [name="dma-test2.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$2001]
.segmentdef Code [start=$2017]
.segmentdef Data [startAfter="Code"]
.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 //
// DMA command copy
.const DMA_COMMAND_COPY = 0
.const OFFSET_STRUCT_F018_DMAGIC_EN018B = 3
.const OFFSET_STRUCT_DMA_LIST_F018B_COUNT = 1
.const OFFSET_STRUCT_DMA_LIST_F018B_SRC = 3
.const OFFSET_STRUCT_DMA_LIST_F018B_DEST = 6
.const OFFSET_STRUCT_F018_DMAGIC_ADDRMB = 4
.const OFFSET_STRUCT_F018_DMAGIC_ADDRBANK = 2
.const OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = 1
// DMAgic F018 Controller
.label DMA = $d700
// Default address of screen character matrix
.label DEFAULT_SCREEN = $800
.segment Code
main: {
// memoryRemap(0,0,0)
// Map memory to BANK 0 : 0x00XXXX - giving access to I/O
jsr memoryRemap
// memcpy_dma(DEFAULT_SCREEN, DEFAULT_SCREEN+80, 24*80)
// Move screen up using DMA
jsr memcpy_dma
// }
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: {
.label aVal = $fc
.label xVal = $fd
.label yVal = $fe
.label zVal = $ff
// *aVal = <lowerPageOffset
lda #0
sta aVal
// *xVal = (remapBlocks << 4) | (>lowerPageOffset & 0xf)
sta xVal
// *yVal = <upperPageOffset
sta yVal
// *zVal = (remapBlocks & 0xf0) | (>upperPageOffset & 0xf)
sta zVal
// asm
lda aVal
ldx xVal
ldy yVal
ldz zVal
map
eom
// }
rts
}
// Copy a memory block within the first 64K memory space using MEGA65 DMagic DMA
// Copies the values of num bytes from the location pointed to by source directly
// to the memory block pointed to by destination.
// The underlying type of the objects pointed to by both the source and destination pointers
// are irrelevant for this function; The result is a binary copy of the data.
memcpy_dma: {
.const num = $18*$50
.label dest = DEFAULT_SCREEN
.label src = DEFAULT_SCREEN+$50
// dmaMode = DMA->EN018B
// Remember current F018 A/B mode
ldx DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// memcpy_dma_command.count = num
// Set up command
lda #<num
sta memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT
lda #>num
sta memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_COUNT+1
// memcpy_dma_command.src = src
lda #<src
sta memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC
lda #>src
sta memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_SRC+1
// memcpy_dma_command.dest = dest
lda #<dest
sta memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST
lda #>dest
sta memcpy_dma_command+OFFSET_STRUCT_DMA_LIST_F018B_DEST+1
// DMA->EN018B = 1
// Set F018B mode
lda #1
sta DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// DMA->ADDRMB = 0
// Set address of DMA list
lda #0
sta DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMB
// DMA->ADDRBANK = 0
sta DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRBANK
// DMA-> ADDRMSB = >&memcpy_dma_command
lda #>memcpy_dma_command
sta DMA+OFFSET_STRUCT_F018_DMAGIC_ADDRMSB
// DMA-> ADDRLSBTRIG = <&memcpy_dma_command
// Trigger the DMA (without option lists)
lda #<memcpy_dma_command
sta DMA
// DMA->EN018B = dmaMode
// Re-enable F018A mode
stx DMA+OFFSET_STRUCT_F018_DMAGIC_EN018B
// }
rts
}
.segment Data
// DMA list entry for copying data
memcpy_dma_command: .byte DMA_COMMAND_COPY
.word 0, 0
.byte 0
.word 0
.byte 0, 0
.word 0

View File

@ -0,0 +1,42 @@
(void()) main()
main: scope:[main] from
[0] phi()
[1] call memoryRemap
to:main::@1
main::@1: scope:[main] from main
[2] phi()
[3] call memcpy_dma
to:main::@return
main::@return: scope:[main] from main::@1
[4] return
to:@return
(void()) memoryRemap((byte) memoryRemap::remapBlocks , (word) memoryRemap::lowerPageOffset , (word) memoryRemap::upperPageOffset)
memoryRemap: scope:[memoryRemap] from main
[5] *((const byte*) memoryRemap::aVal) ← (byte) 0
[6] *((const byte*) memoryRemap::xVal) ← (byte) 0
[7] *((const byte*) memoryRemap::yVal) ← (byte) 0
[8] *((const byte*) memoryRemap::zVal) ← (byte) 0
asm { ldaaVal ldxxVal ldyyVal ldzzVal map eom }
to:memoryRemap::@return
memoryRemap::@return: scope:[memoryRemap] from memoryRemap
[10] return
to:@return
(void()) memcpy_dma((void*) memcpy_dma::dest , (void*) memcpy_dma::src , (word) memcpy_dma::num)
memcpy_dma: scope:[memcpy_dma] from main::@1
[11] (byte) memcpy_dma::dmaMode#0 ← *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B)
[12] *((word*)&(struct DMA_LIST_F018B) memcpy_dma_command+(const byte) OFFSET_STRUCT_DMA_LIST_F018B_COUNT) ← (const word) memcpy_dma::num#0
[13] *((byte**)&(struct DMA_LIST_F018B) memcpy_dma_command+(const byte) OFFSET_STRUCT_DMA_LIST_F018B_SRC) ← (byte*)(const void*) memcpy_dma::src#0
[14] *((byte**)&(struct DMA_LIST_F018B) memcpy_dma_command+(const byte) OFFSET_STRUCT_DMA_LIST_F018B_DEST) ← (byte*)(const void*) memcpy_dma::dest#0
[15] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B) ← (byte) 1
[16] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMB) ← (byte) 0
[17] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRBANK) ← (byte) 0
[18] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMSB) ← >&(struct DMA_LIST_F018B) memcpy_dma_command
[19] *((byte*)(const nomodify struct F018_DMAGIC*) DMA) ← <&(struct DMA_LIST_F018B) memcpy_dma_command
[20] *((byte*)(const nomodify struct F018_DMAGIC*) DMA+(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B) ← (byte) memcpy_dma::dmaMode#0
to:memcpy_dma::@return
memcpy_dma::@return: scope:[memcpy_dma] from memcpy_dma
[21] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,345 @@
(const nomodify byte*) DEFAULT_SCREEN = (byte*) 2048
(const nomodify struct F018_DMAGIC*) DMA = (struct F018_DMAGIC*) 55040
(const nomodify byte) DMA_COMMAND_COPY = (byte) 0
(byte) DMA_LIST_F018A::command
(word) DMA_LIST_F018A::count
(byte*) DMA_LIST_F018A::dest
(byte) DMA_LIST_F018A::dest_bank
(word) DMA_LIST_F018A::modulo
(byte*) DMA_LIST_F018A::src
(byte) DMA_LIST_F018A::src_bank
(byte) DMA_LIST_F018B::command
(word) DMA_LIST_F018B::count
(byte*) DMA_LIST_F018B::dest
(byte) DMA_LIST_F018B::dest_bank
(word) DMA_LIST_F018B::modulo
(byte*) DMA_LIST_F018B::src
(byte) DMA_LIST_F018B::src_bank
(byte) DMA_LIST_F018B::sub_command
(byte) F018_DMAGIC::ADDRBANK
(byte) F018_DMAGIC::ADDRLSB
(byte) F018_DMAGIC::ADDRLSBTRIG
(byte) F018_DMAGIC::ADDRMB
(byte) F018_DMAGIC::ADDRMSB
(byte) F018_DMAGIC::EN018B
(byte) F018_DMAGIC::ETRIG
(byte) F018_DMAGIC::MISC
(const byte*) F018_DMAGIC::UNUSED1[(number) 8] = { fill( 8, 0) }
(byte) F018_DMAGIC::UNUSED2
(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) OFFSET_STRUCT_DMA_LIST_F018B_COUNT = (byte) 1
(const byte) OFFSET_STRUCT_DMA_LIST_F018B_DEST = (byte) 6
(const byte) OFFSET_STRUCT_DMA_LIST_F018B_SRC = (byte) 3
(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRBANK = (byte) 2
(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMB = (byte) 4
(const byte) OFFSET_STRUCT_F018_DMAGIC_ADDRMSB = (byte) 1
(const byte) OFFSET_STRUCT_F018_DMAGIC_EN018B = (byte) 3
(void()) main()
(label) main::@1
(label) main::@return
(void()) memcpy_dma((void*) memcpy_dma::dest , (void*) memcpy_dma::src , (word) memcpy_dma::num)
(label) memcpy_dma::@return
(void*) memcpy_dma::dest
(const void*) memcpy_dma::dest#0 dest = (void*)(const nomodify byte*) DEFAULT_SCREEN
(byte) memcpy_dma::dmaMode
(byte) memcpy_dma::dmaMode#0 reg byte x 2.4444444444444446
(word) memcpy_dma::num
(const word) memcpy_dma::num#0 num = (word)(number) $18*(number) $50
(void*) memcpy_dma::src
(const void*) memcpy_dma::src#0 src = (void*)(const nomodify byte*) DEFAULT_SCREEN+(byte) $50
(struct DMA_LIST_F018B) memcpy_dma_command loadstore mem[12] = { command: (const nomodify byte) DMA_COMMAND_COPY, count: (word) 0, src: (byte*) 0, src_bank: (byte) 0, dest: (byte*) 0, dest_bank: (byte) 0, sub_command: (byte) 0, modulo: (word) 0 }
(void()) memoryRemap((byte) memoryRemap::remapBlocks , (word) memoryRemap::lowerPageOffset , (word) memoryRemap::upperPageOffset)
(label) memoryRemap::@return
(const byte*) memoryRemap::aVal = (byte*) 252
(word) memoryRemap::lowerPageOffset
(byte) memoryRemap::remapBlocks
(word) memoryRemap::upperPageOffset
(const byte*) memoryRemap::xVal = (byte*) 253
(const byte*) memoryRemap::yVal = (byte*) 254
(const byte*) memoryRemap::zVal = (byte*) 255
reg byte x [ memcpy_dma::dmaMode#0 ]
mem[12] [ memcpy_dma_command ]