mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-08 14:37:40 +00:00
Fixed comments.
This commit is contained in:
parent
aee57979ef
commit
34e9c50775
@ -985,11 +985,16 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
// Add comments to constant
|
||||
variable.setComments(ensureUnusedComments(declComments));
|
||||
} else if(!variable.isKindConstant() && !isStructMember) {
|
||||
final List<Comment> comments = ensureUnusedComments(declComments);
|
||||
Statement initStmt = new StatementAssignment(variable.getVariableRef(), initValue, true, statementSource, comments);
|
||||
Statement initStmt = new StatementAssignment(variable.getVariableRef(), initValue, true, statementSource, Comment.NO_COMMENTS);
|
||||
addStatement(initStmt);
|
||||
// Add comments to variable
|
||||
variable.setComments(comments);
|
||||
if(variable.getScope().getRef().equals(ScopeRef.ROOT)) {
|
||||
// Add comments to variable for global vars
|
||||
variable.setComments(ensureUnusedComments(declComments));
|
||||
} else {
|
||||
// Add comments to statement for local vars
|
||||
initStmt.setComments(ensureUnusedComments(declComments));
|
||||
}
|
||||
|
||||
}
|
||||
if(initializer != null)
|
||||
PrePostModifierHandler.addPostModifiers(this, initializer, statementSource);
|
||||
|
@ -1255,7 +1255,7 @@ public class TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testInnerIncrementProblem() throws IOException, URISyntaxException {
|
||||
compileAndCompare("inner-increment-problem.c", log());
|
||||
compileAndCompare("inner-increment-problem.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -14,7 +14,6 @@ main: {
|
||||
.label SCREEN1 = $400
|
||||
.label SCREEN2 = SCREEN1+$28
|
||||
// Use address-of - hereafter all versions of val must be in the same memory
|
||||
// Use address-of - hereafter all versions of val must be in the same memory
|
||||
.label ptr = val
|
||||
// SCREEN1[idx] = val
|
||||
lda.z val
|
||||
|
@ -136,7 +136,6 @@ bitmap_line_xdyi: {
|
||||
}
|
||||
// bitmap_plot(byte register(X) x, byte register(Y) y)
|
||||
bitmap_plot: {
|
||||
// Needs unsigned int arrays arranged as two underlying char arrays to allow char* plotter_x = plot_x[x]; - and eventually - char* plotter = plot_x[x] + plot_y[y];
|
||||
.label plotter_x = 7
|
||||
.label plotter_y = 9
|
||||
.label plotter = 7
|
||||
|
@ -64,9 +64,7 @@ bitmap_line: {
|
||||
.label dy = 8
|
||||
.label sx = $12
|
||||
.label sy = 6
|
||||
// X is the driver
|
||||
.label e1 = 4
|
||||
// Y is the driver
|
||||
.label e = $c
|
||||
.label y = 2
|
||||
.label x = $e
|
||||
|
@ -597,14 +597,10 @@ sin16s_gen2: {
|
||||
.label wavelength = $200
|
||||
.label __6 = 8
|
||||
.label __8 = $24
|
||||
// ampl is always positive so shifting left does not alter the sign
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $20
|
||||
.label sintab = $19
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = $c
|
||||
.label i = $17
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -705,23 +701,14 @@ sin16s: {
|
||||
.label __4 = $26
|
||||
.label x = $10
|
||||
.label return = $1b
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $2a
|
||||
// u[1.15]
|
||||
.label x2 = $14
|
||||
// u[2.14] x^2
|
||||
.label x3 = $14
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $2c
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $1b
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $14
|
||||
// u[3.13] x^4
|
||||
.label x5 = $2c
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $2c
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $1b
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
|
@ -634,14 +634,10 @@ sin16s_gen2: {
|
||||
.label wavelength = $200
|
||||
.label __6 = $b
|
||||
.label __8 = $25
|
||||
// ampl is always positive so shifting left does not alter the sign
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $21
|
||||
.label sintab = $1a
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = $11
|
||||
.label i = $f
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -742,23 +738,14 @@ sin16s: {
|
||||
.label __4 = $27
|
||||
.label x = $15
|
||||
.label return = 4
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $2d
|
||||
// u[1.15]
|
||||
.label x2 = $1e
|
||||
// u[2.14] x^2
|
||||
.label x3 = $1e
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $2b
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = 4
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $1e
|
||||
// u[3.13] x^4
|
||||
.label x5 = $2b
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $2b
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = 4
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
|
@ -97,9 +97,7 @@ bitmap_line: {
|
||||
.label dy = 8
|
||||
.label sx = $16
|
||||
.label sy = 6
|
||||
// X is the driver
|
||||
.label e1 = $e
|
||||
// Y is the driver
|
||||
.label e = $a
|
||||
.label y = $c
|
||||
.label x = 4
|
||||
|
@ -263,7 +263,6 @@ gfx_init: {
|
||||
}
|
||||
// Initialize Plane with 8bpp charset
|
||||
gfx_init_plane_charset8: {
|
||||
// 8bpp cells for Plane B (charset) - ROM charset with 256 colors
|
||||
// 8bpp cells for Plane B (charset) - ROM charset with 256 colors
|
||||
.const gfxbCpuBank = $ff&CHARSET8/$4000
|
||||
.label bits = 2
|
||||
@ -355,7 +354,6 @@ gfx_init_plane_charset8: {
|
||||
// The actual memory addressed will be $4000*cpuSegmentIdx
|
||||
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
|
||||
dtvSetCpuBankSegment1: {
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
.label cpuBank = $ff
|
||||
// *cpuBank = cpuBankIdx
|
||||
|
@ -309,7 +309,6 @@ gfx_init_chunky: {
|
||||
// The actual memory addressed will be $4000*cpuSegmentIdx
|
||||
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
|
||||
dtvSetCpuBankSegment1: {
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
.label cpuBank = $ff
|
||||
// *cpuBank = cpuBankIdx
|
||||
|
@ -70,7 +70,6 @@
|
||||
.label DTV_BLITTER_CONTROL2 = $d33f
|
||||
.label SCREEN = $400
|
||||
// Controls the ALU operation
|
||||
// Controls the ALU operation
|
||||
.label DTV_BLITTER_ALU = $d33e
|
||||
main: {
|
||||
// *DTV_FEATURE = DTV_FEATURE_ENABLE
|
||||
|
@ -75,7 +75,6 @@
|
||||
.label DTV_BLITTER_CONTROL2 = $d33f
|
||||
.label SCREEN = $400
|
||||
// Controls the ALU operation
|
||||
// Controls the ALU operation
|
||||
.label DTV_BLITTER_ALU = $d33e
|
||||
main: {
|
||||
// *DTV_FEATURE = DTV_FEATURE_ENABLE
|
||||
|
@ -75,7 +75,6 @@
|
||||
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
|
||||
.const OFFSET_STRUCT_MOS6569_VICII_MEMORY = $18
|
||||
// Number of form fields
|
||||
// Number of form fields
|
||||
.const form_fields_cnt = $24
|
||||
.label VIC_CONTROL = $d011
|
||||
.label VIC_CONTROL2 = $d016
|
||||
@ -228,7 +227,6 @@ gfx_mode: {
|
||||
.label __83 = $10
|
||||
.label plane_a = 2
|
||||
.label plane_b = 2
|
||||
// VIC Colors
|
||||
.label vic_colors = 6
|
||||
.label col = $d
|
||||
.label cy = $f
|
||||
@ -1726,7 +1724,6 @@ form_control: {
|
||||
// Set the screen to use for the form.
|
||||
// screen is the start address of the screen to use
|
||||
form_set_screen: {
|
||||
// Calculate the field line table
|
||||
.label line = 6
|
||||
ldx #0
|
||||
lda #<FORM_SCREEN
|
||||
@ -2036,7 +2033,6 @@ gfx_init_plane_fill: {
|
||||
// The actual memory addressed will be $4000*cpuSegmentIdx
|
||||
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
|
||||
dtvSetCpuBankSegment1: {
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
.label cpuBank = $ff
|
||||
// *cpuBank = cpuBankIdx
|
||||
@ -2235,7 +2231,6 @@ gfx_init_plane_horisontal: {
|
||||
}
|
||||
// Initialize Plane with 8bpp charset
|
||||
gfx_init_plane_charset8: {
|
||||
// 8bpp cells for Plane B (charset) - ROM charset with 256 colors
|
||||
// 8bpp cells for Plane B (charset) - ROM charset with 256 colors
|
||||
.const gfxbCpuBank = PLANE_CHARSET8/$4000
|
||||
.label bits = $22
|
||||
@ -2609,7 +2604,6 @@ bitmap_line_xdyi: {
|
||||
}
|
||||
// bitmap_plot(byte register(Y) x, byte register(X) y)
|
||||
bitmap_plot: {
|
||||
// Needs unsigned int arrays arranged as two underlying char arrays to allow char* plotter_x = plot_x[x]; - and eventually - char* plotter = plot_x[x] + plot_y[y];
|
||||
.label plotter_x = $1c
|
||||
.label plotter_y = $1e
|
||||
.label plotter = $1c
|
||||
|
@ -475,7 +475,6 @@ mode_8bppchunkybmm: {
|
||||
}
|
||||
// Allow the user to control the DTV graphics using different keys
|
||||
mode_ctrl: {
|
||||
// Read the current control byte
|
||||
// DTV Graphics Mode - Reset
|
||||
.label ctrl = 3
|
||||
__b1:
|
||||
@ -497,7 +496,6 @@ mode_ctrl: {
|
||||
__b4:
|
||||
// ctrl = dtv_control
|
||||
// Read the current control byte
|
||||
// DTV Graphics Mode - Reset
|
||||
stx.z ctrl
|
||||
// keyboard_key_pressed(KEY_L)
|
||||
ldy #KEY_L
|
||||
@ -640,7 +638,6 @@ keyboard_matrix_read: {
|
||||
// The actual memory addressed will be $4000*cpuSegmentIdx
|
||||
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
|
||||
dtvSetCpuBankSegment1: {
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
|
||||
.label cpuBank = $ff
|
||||
// *cpuBank = cpuBankIdx
|
||||
@ -669,7 +666,6 @@ mode_8bpppixelcell: {
|
||||
.label CHARGEN = $d000
|
||||
.label __3 = 8
|
||||
// Screen Chars for Plane A (screen) - 16x16 repeating
|
||||
// Screen Chars for Plane A (screen) - 16x16 repeating
|
||||
.label gfxa = 6
|
||||
.label ay = 2
|
||||
.label bits = $f
|
||||
@ -861,15 +857,12 @@ mode_sixsfred: {
|
||||
.label PLANEB = $6000
|
||||
.label COLORS = $8000
|
||||
// Colors for high 4 bits of 8bpp
|
||||
// Colors for high 4 bits of 8bpp
|
||||
.label col = 4
|
||||
.label cy = $a
|
||||
// Graphics for Plane A () - horizontal stripes every 2 pixels
|
||||
// Graphics for Plane A () - horizontal stripes every 2 pixels
|
||||
.label gfxa = 6
|
||||
.label ay = $f
|
||||
// Graphics for Plane B - vertical stripes every 2 pixels
|
||||
// Graphics for Plane B - vertical stripes every 2 pixels
|
||||
.label gfxb = $d
|
||||
.label by = $11
|
||||
// *DTV_CONTROL = DTV_HIGHCOLOR | DTV_LINEAR
|
||||
@ -1054,16 +1047,12 @@ mode_twoplanebitmap: {
|
||||
.label __3 = 8
|
||||
// Color for bits 11
|
||||
// Colors for bits 01 / 10
|
||||
// Color for bits 11
|
||||
// Colors for bits 01 / 10
|
||||
.label col = 6
|
||||
.label cy = 2
|
||||
// Graphics for Plane A - horizontal stripes
|
||||
// Graphics for Plane A - horizontal stripes
|
||||
.label gfxa = $d
|
||||
.label ay = 3
|
||||
// Graphics for Plane B - vertical stripes
|
||||
// Graphics for Plane B - vertical stripes
|
||||
.label gfxb = 4
|
||||
.label by = $a
|
||||
// *DTV_CONTROL = DTV_HIGHCOLOR | DTV_LINEAR
|
||||
@ -1270,15 +1259,12 @@ mode_sixsfred2: {
|
||||
.label COLORS = $8000
|
||||
.label __3 = 9
|
||||
// Colors for high 4 bits of 8bpp
|
||||
// Colors for high 4 bits of 8bpp
|
||||
.label col = 4
|
||||
.label cy = 2
|
||||
// Graphics for Plane A () - horizontal stripes every 2 pixels
|
||||
// Graphics for Plane A () - horizontal stripes every 2 pixels
|
||||
.label gfxa = 6
|
||||
.label ay = 3
|
||||
// Graphics for Plane B - vertical stripes every 2 pixels
|
||||
// Graphics for Plane B - vertical stripes every 2 pixels
|
||||
.label gfxb = $d
|
||||
.label by = $a
|
||||
// *DTV_CONTROL = DTV_LINEAR
|
||||
@ -1474,7 +1460,6 @@ mode_hicolmcchar: {
|
||||
.label COLORS = $8400
|
||||
.label __3 = 9
|
||||
// Char Colors and screen chars
|
||||
// Char Colors and screen chars
|
||||
.label col = 6
|
||||
.label ch = $d
|
||||
.label cy = $f
|
||||
@ -1612,7 +1597,6 @@ mode_hicolecmchar: {
|
||||
.label COLORS = $8400
|
||||
.label __3 = $a
|
||||
// Char Colors and screen chars
|
||||
// Char Colors and screen chars
|
||||
.label col = 6
|
||||
.label ch = $d
|
||||
.label cy = $f
|
||||
@ -1749,7 +1733,6 @@ mode_hicolstdchar: {
|
||||
.label COLORS = $8400
|
||||
.label __3 = $a
|
||||
// Char Colors and screen chars
|
||||
// Char Colors and screen chars
|
||||
.label col = 6
|
||||
.label ch = $d
|
||||
.label cy = $11
|
||||
@ -1875,7 +1858,6 @@ mode_stdbitmap: {
|
||||
.label BITMAP = $6000
|
||||
.label col2 = $f
|
||||
// Bitmap Colors
|
||||
// Bitmap Colors
|
||||
.label ch = 4
|
||||
.label cy = $11
|
||||
.label l = $a
|
||||
@ -2176,7 +2158,6 @@ bitmap_line_xdyi: {
|
||||
}
|
||||
// bitmap_plot(byte register(Y) x, byte register(X) y)
|
||||
bitmap_plot: {
|
||||
// Needs unsigned int arrays arranged as two underlying char arrays to allow char* plotter_x = plot_x[x]; - and eventually - char* plotter = plot_x[x] + plot_y[y];
|
||||
.label plotter_x = $b
|
||||
.label plotter_y = $d
|
||||
.label plotter = $b
|
||||
@ -2464,7 +2445,6 @@ mode_mcchar: {
|
||||
.label COLORS = $d800
|
||||
.label __5 = $f
|
||||
// Char Colors and screen chars
|
||||
// Char Colors and screen chars
|
||||
.label col = 4
|
||||
.label ch = $d
|
||||
.label cy = $a
|
||||
@ -2607,7 +2587,6 @@ mode_ecmchar: {
|
||||
.label COLORS = $d800
|
||||
.label __5 = $10
|
||||
// Char Colors and screen chars
|
||||
// Char Colors and screen chars
|
||||
.label col = $d
|
||||
.label ch = 6
|
||||
.label cy = $f
|
||||
@ -2748,7 +2727,6 @@ mode_stdchar: {
|
||||
.label COLORS = $d800
|
||||
.label __5 = $11
|
||||
// Char Colors and screen chars
|
||||
// Char Colors and screen chars
|
||||
.label col = 6
|
||||
.label ch = $d
|
||||
.label cy = $10
|
||||
|
@ -18,7 +18,6 @@
|
||||
.label SCREEN = $400
|
||||
main: {
|
||||
.label __1 = 9
|
||||
// Calculate the cycle count - 0x12 is the base usage of start/read
|
||||
.label cyclecount = 9
|
||||
__b1:
|
||||
// clock_start()
|
||||
|
@ -43,9 +43,7 @@ _start: {
|
||||
main: {
|
||||
.label __9 = $10
|
||||
.label __10 = $d
|
||||
// yd = y-12
|
||||
.label yd = $f
|
||||
// dist_sq = xd*xd + yd*yd
|
||||
.label dist_sq = $10
|
||||
.label y = 9
|
||||
.label sc = $b
|
||||
|
@ -80,7 +80,6 @@
|
||||
// Sprite data for the animating sprites
|
||||
.label SPRITE_DATA = $2000
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
// Head of the heap. Moved backward each malloc()
|
||||
.label heap_head = 8
|
||||
@ -230,7 +229,6 @@ startProcessing: {
|
||||
.label center_x = $21
|
||||
.label center_y = $10
|
||||
.label i = 5
|
||||
// Copy char into sprite
|
||||
.label offset = $22
|
||||
.label colPtr = $13
|
||||
.label spriteCol = $15
|
||||
@ -241,7 +239,6 @@ startProcessing: {
|
||||
.label spriteY = $18
|
||||
.label spritePtr = $1a
|
||||
// Busy-wait while finding an empty slot in the PROCESSING array
|
||||
// Busy-wait while finding an empty slot in the PROCESSING array
|
||||
.label freeIdx = 5
|
||||
.label __33 = $11
|
||||
.label __34 = $22
|
||||
@ -881,7 +878,6 @@ atan2_16: {
|
||||
.label yi = $11
|
||||
.label xi = $13
|
||||
.label angle = $16
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = $1b
|
||||
.label yd = $18
|
||||
.label return = $16
|
||||
|
@ -76,10 +76,8 @@ main: {
|
||||
.const toD0182_return = (>(SCREEN&$3fff)*4)|(>CANVAS2)/4&$f
|
||||
.label cols = 3
|
||||
// Setup 16x16 canvas for rendering
|
||||
// Setup 16x16 canvas for rendering
|
||||
.label screen = 5
|
||||
.label y = 2
|
||||
// Plot in line buffer
|
||||
.label x0 = $13
|
||||
.label y0 = $14
|
||||
.label x1 = $c
|
||||
@ -90,7 +88,6 @@ main: {
|
||||
.label p1_idx = 8
|
||||
.label p2_idx = 9
|
||||
// The current canvas being rendered to
|
||||
// The current canvas being rendered to
|
||||
.label canvas = $a
|
||||
// memset(CONSOLE, ' ', 40*25)
|
||||
// Clear the console
|
||||
@ -380,19 +377,13 @@ line: {
|
||||
.label dy = $18
|
||||
.label sx = $19
|
||||
.label sy = $1a
|
||||
// Find the canvas column
|
||||
.label plot1_column = $21
|
||||
.label plot2_y = $1b
|
||||
// Find the canvas column
|
||||
.label plot2_column = $1c
|
||||
// Find the canvas column
|
||||
.label plot3_column = $1f
|
||||
.label e1 = $e
|
||||
// Find the canvas column
|
||||
.label plot4_column = $23
|
||||
// Find the canvas column
|
||||
.label plot5_column = $25
|
||||
// Find the canvas column
|
||||
.label plot6_column = $28
|
||||
// abs_u8(x2-x1)
|
||||
lda.z x2
|
||||
|
@ -44,7 +44,6 @@
|
||||
main: {
|
||||
.const origY = $a00
|
||||
// Row and column offset vectors
|
||||
// Row and column offset vectors
|
||||
.const rowOffsetX = $c00
|
||||
.const colOffsetX = $100
|
||||
.const colOffsetY = $1800
|
||||
@ -60,7 +59,6 @@ main: {
|
||||
.label rowY = 6
|
||||
.label col = $e
|
||||
// Origin point
|
||||
// Origin point
|
||||
.label origX = $c
|
||||
.label rowOffsetY = 2
|
||||
// mulf_init()
|
||||
@ -527,7 +525,6 @@ prepareBobs: {
|
||||
.label bob_table = $1b
|
||||
.label shift_y = $11
|
||||
// Populate charset and tables
|
||||
// Populate charset and tables
|
||||
.label bob_glyph = $f
|
||||
.label cell = $14
|
||||
.label bob_table_idx = $12
|
||||
@ -822,22 +819,17 @@ protoBobShiftDown: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = $11
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = $1b
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $19
|
||||
.label sqr1_lo = $f
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $16
|
||||
.label sqr2_lo = $1d
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $12
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -56,7 +56,6 @@ main: {
|
||||
.label r = 7
|
||||
.label i = 3
|
||||
// Render Rotated BOBs
|
||||
// Render Rotated BOBs
|
||||
.label angle = 6
|
||||
// mulf_init()
|
||||
jsr mulf_init
|
||||
@ -585,7 +584,6 @@ prepareBobs: {
|
||||
.label bob_table = $14
|
||||
.label shift_y = $a
|
||||
// Populate charset and tables
|
||||
// Populate charset and tables
|
||||
.label bob_glyph = 8
|
||||
.label cell = $f
|
||||
.label bob_table_idx = $b
|
||||
@ -881,22 +879,17 @@ shiftProtoBobDown: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = $a
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = $14
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $10
|
||||
.label sqr1_lo = 8
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $c
|
||||
.label sqr2_lo = $16
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $b
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -123,7 +123,6 @@ loop: {
|
||||
.label r = 7
|
||||
.label i = 2
|
||||
// Render Rotated BOBs
|
||||
// Render Rotated BOBs
|
||||
.label angle = 4
|
||||
.label plexFreeNextYpos1_return = $15
|
||||
.label i1 = 3
|
||||
@ -625,22 +624,17 @@ memset: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = 7
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = 8
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $f
|
||||
.label sqr1_lo = 5
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $c
|
||||
.label sqr2_lo = $a
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $e
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -311,9 +311,7 @@ bitmap_line: {
|
||||
.label dy = $1a
|
||||
.label sx = $20
|
||||
.label sy = $1e
|
||||
// X is the driver
|
||||
.label e1 = 9
|
||||
// Y is the driver
|
||||
.label e = 7
|
||||
.label x1 = $f
|
||||
.label y1 = $11
|
||||
@ -960,11 +958,8 @@ rotate: {
|
||||
.label return_x = 3
|
||||
.label return_y = 5
|
||||
.label cos_a = $18
|
||||
// signed fixed[0.7]
|
||||
.label xr = $1a
|
||||
// signed fixed[8.8]
|
||||
.label yr = $1c
|
||||
// signed fixed[8.8]
|
||||
.label sin_a = $18
|
||||
// cos_a = (signed int) COS[angle]
|
||||
lda COS,y
|
||||
@ -1409,22 +1404,17 @@ bitmap_init: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = $26
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = $16
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $18
|
||||
.label sqr1_lo = $14
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $20
|
||||
.label sqr2_lo = $1c
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $13
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -396,7 +396,6 @@ font_2x2_to_sprites: {
|
||||
.label __3 = $1b
|
||||
.label char_right = $b
|
||||
.label sprite_idx = $18
|
||||
// Upper char
|
||||
.label char_left = 9
|
||||
.label char_current = $19
|
||||
.label sprite = 7
|
||||
|
@ -273,7 +273,6 @@ sprites_init: {
|
||||
// Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers
|
||||
sprites_irq: {
|
||||
.const toSpritePtr1_return = $ff&PLAYFIELD_SPRITES/$40
|
||||
// Wait for the y-position before changing sprite pointers
|
||||
.label raster_sprite_gfx_modify = $b
|
||||
sta rega+1
|
||||
stx regx+1
|
||||
|
@ -462,11 +462,9 @@ render_bcd: {
|
||||
}
|
||||
// Render the next tetromino in the "next" area
|
||||
render_next: {
|
||||
// Find the screen area
|
||||
// Find the screen area
|
||||
.const next_area_offset = $28*$c+$18+4
|
||||
.label next_piece_char = $32
|
||||
// Render the next piece
|
||||
.label next_piece_gfx = $2c
|
||||
.label screen_next_area = $2e
|
||||
.label l = $c
|
||||
@ -619,7 +617,6 @@ render_moving: {
|
||||
render_playfield: {
|
||||
.label screen_line = $2c
|
||||
// Do not render the top 2 lines.
|
||||
// Do not render the top 2 lines.
|
||||
.label i = $1d
|
||||
.label c = $1e
|
||||
.label l = $1c
|
||||
@ -707,7 +704,6 @@ play_movement: {
|
||||
// Return non-zero if a render is needed
|
||||
// play_move_rotate(byte register(A) key_event)
|
||||
play_move_rotate: {
|
||||
// Handle keyboard events
|
||||
// Handle keyboard events
|
||||
.label orientation = $c
|
||||
// if(key_event==KEY_Z)
|
||||
@ -1031,8 +1027,6 @@ play_spawn_current: {
|
||||
.label __7 = $33
|
||||
// Spawn a new next piece
|
||||
// Pick a random piece (0-6)
|
||||
// Spawn a new next piece
|
||||
// Pick a random piece (0-6)
|
||||
.label piece_idx = $1a
|
||||
// current_piece_idx = next_piece_idx
|
||||
// Move next piece into current
|
||||
@ -1553,7 +1547,6 @@ render_show: {
|
||||
play_init: {
|
||||
.label pli = $2c
|
||||
// Initialize the playfield line pointers;
|
||||
// Initialize the playfield line pointers;
|
||||
.label idx = $32
|
||||
lda #0
|
||||
sta.z idx
|
||||
@ -1706,7 +1699,6 @@ sprites_init: {
|
||||
render_init: {
|
||||
.const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)/$40
|
||||
// Initialize the screen line pointers;
|
||||
// Initialize the screen line pointers;
|
||||
.label li_1 = $2c
|
||||
.label li_2 = $2e
|
||||
// CIA2->PORT_A_DDR = %00000011
|
||||
@ -1908,7 +1900,6 @@ render_screen_original: {
|
||||
// Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers
|
||||
sprites_irq: {
|
||||
.const toSpritePtr1_return = $ff&PLAYFIELD_SPRITES/$40
|
||||
// Wait for the y-position before changing sprite pointers
|
||||
.label raster_sprite_gfx_modify = $3c
|
||||
sta rega+1
|
||||
stx regx+1
|
||||
|
@ -33,7 +33,6 @@ syscall1: {
|
||||
rts
|
||||
}
|
||||
main: {
|
||||
// Print message
|
||||
// Print message
|
||||
.label sc = 4
|
||||
.label msg = 2
|
||||
|
@ -3,7 +3,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// Create pointers to the palette RGBs in the logo (assumes dimensions are 128x128)
|
||||
// Create pointers to the palette RGBs in the logo (assumes dimensions are 128x128)
|
||||
.label LOGO256_RED = LOGO256+$80*$80
|
||||
.label LOGO256_GREEN = LOGO256_RED+$100
|
||||
|
@ -16,10 +16,6 @@ main: {
|
||||
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
|
||||
.label col00 = COLS+$c*$28+$13
|
||||
.label __4 = $a
|
||||
//byte angle_b = atan2_8(x, y);
|
||||
//diff_sum += diff(angle_b, *screen_ref);
|
||||
//*screen = angle_b - *screen_ref++;
|
||||
//*screen = angle_b;
|
||||
.label xw = $17
|
||||
.label yw = $19
|
||||
.label angle_w = $a
|
||||
@ -202,7 +198,6 @@ atan2_16: {
|
||||
.label yi = $e
|
||||
.label xi = $11
|
||||
.label angle = $a
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = $c
|
||||
.label yd = $13
|
||||
.label return = $a
|
||||
|
@ -90,7 +90,6 @@ atan2_16: {
|
||||
.label yi = $a
|
||||
.label xi = $d
|
||||
.label angle = 6
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = 8
|
||||
.label yd = $f
|
||||
.label return = 6
|
||||
|
@ -13,7 +13,6 @@
|
||||
main: {
|
||||
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
|
||||
// Clear the screen by modifying the charset
|
||||
// Clear the screen by modifying the charset
|
||||
.label clear_char = 2
|
||||
// init_font_hex(CHARSET)
|
||||
jsr init_font_hex
|
||||
@ -178,7 +177,6 @@ atan2_16: {
|
||||
.label yi = $11
|
||||
.label xi = 4
|
||||
.label angle = 6
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = $a
|
||||
.label yd = 8
|
||||
.label return = 6
|
||||
|
@ -21,17 +21,14 @@
|
||||
// The VIC-II MOS 6567/6569
|
||||
.label VICII = $d000
|
||||
// The rotated point - updated by calling rotate_matrix()
|
||||
// The rotated point - updated by calling rotate_matrix()
|
||||
.label xr = $f0
|
||||
.label yr = $f1
|
||||
.label zr = $f2
|
||||
// The rotated point with perspective
|
||||
// The rotated point with perspective
|
||||
.label pp = $f3
|
||||
.label xp = $f4
|
||||
.label yp = $f5
|
||||
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2
|
||||
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2
|
||||
.label psp1 = $f6
|
||||
.label psp2 = $f8
|
||||
.label SCREEN = $400
|
||||
@ -623,13 +620,9 @@ calculate_matrix: {
|
||||
.label t3 = 7
|
||||
.label t4 = 8
|
||||
.label t5 = 9
|
||||
// = sx+sy+sz
|
||||
.label t6 = $a
|
||||
// = sx-sy+sz
|
||||
.label t7 = $b
|
||||
// = sx+sy-sz
|
||||
.label t8 = $c
|
||||
// = sy+sz-sx
|
||||
.label t9 = $d
|
||||
// t1 = sy-sz
|
||||
lda.z sy
|
||||
|
@ -8,13 +8,11 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// The rotated point - updated by calling rotate()
|
||||
// The rotated point - updated by calling rotate()
|
||||
.label xr = $f0
|
||||
.label yr = $f1
|
||||
.label zr = $f2
|
||||
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2.
|
||||
// Pointers used to multiply perspective (d/z0-z) onto x- & y-coordinates. Points into mulf_sqr1 / mulf_sqr2.
|
||||
.label psp1 = $f3
|
||||
.label psp2 = $f5
|
||||
.label print_screen = $400
|
||||
|
@ -236,7 +236,6 @@ bitmap_line_xdyi: {
|
||||
}
|
||||
// bitmap_plot(byte register(X) x, byte register(Y) y)
|
||||
bitmap_plot: {
|
||||
// Needs unsigned int arrays arranged as two underlying char arrays to allow char* plotter_x = plot_x[x]; - and eventually - char* plotter = plot_x[x] + plot_y[y];
|
||||
.label plotter_x = 9
|
||||
.label plotter_y = $b
|
||||
.label plotter = 9
|
||||
|
@ -73,10 +73,8 @@ main: {
|
||||
.label i = 4
|
||||
.label ch = 7
|
||||
// Which char canvas to use
|
||||
// Which char canvas to use
|
||||
.label cur_pos = 5
|
||||
// Is shift pressed
|
||||
// Is shift pressed
|
||||
.label shift = 6
|
||||
lda #<SCREEN
|
||||
sta.z sc
|
||||
|
@ -412,7 +412,6 @@ printf_ulong: {
|
||||
printf_number_buffer: {
|
||||
.label __19 = $a
|
||||
.label buffer_sign = $1a
|
||||
// There is a minimum length - work out the padding
|
||||
.label len = $11
|
||||
.label padding = $10
|
||||
.label format_min_length = $10
|
||||
|
@ -711,7 +711,6 @@ ultoa_append: {
|
||||
// The solution uses the board itself as a "cursor" moving through all possibilities
|
||||
// When all columns on a row is exhausted move back down to the lower level and move forward one position until we are done with the last position on the first row
|
||||
queens: {
|
||||
// The current row where the queen is moving
|
||||
// The current row where the queen is moving
|
||||
.label row = $d
|
||||
lda #<0
|
||||
|
@ -8,7 +8,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// Pointers to a, b and c=a*b
|
||||
// Pointers to a, b and c=a*b
|
||||
.label ap = $fd
|
||||
.label bp = $fe
|
||||
|
@ -98,9 +98,7 @@ main: {
|
||||
}
|
||||
// Animate the fire on the passed screen. Uses BUFFER to store the current values.
|
||||
fire: {
|
||||
// Average characters from below the current character (24 lines)
|
||||
.label screen = 2
|
||||
// Average characters from below the current character (24 lines)
|
||||
.label screen_1 = $b
|
||||
.label buffer = 4
|
||||
.label buffer_1 = 9
|
||||
|
@ -24,7 +24,6 @@
|
||||
// The VIC-II MOS 6567/6569
|
||||
.label VICII = $d000
|
||||
// Location of screen & sprites
|
||||
// Location of screen & sprites
|
||||
.label SCREEN = $400
|
||||
// The address of the sprite pointers on the current screen (screen+0x3f8).
|
||||
.label PLEX_SCREEN_PTR = SCREEN+$3f8
|
||||
@ -63,7 +62,6 @@ main: {
|
||||
}
|
||||
// The raster loop
|
||||
loop: {
|
||||
// The current index into the y-sinus
|
||||
// The current index into the y-sinus
|
||||
.label sin_idx = 2
|
||||
.label plexFreeNextYpos1_return = $a
|
||||
@ -301,7 +299,6 @@ plexSort: {
|
||||
}
|
||||
// Initialize the program
|
||||
init: {
|
||||
// Set the x-positions & pointers
|
||||
// Set the x-positions & pointers
|
||||
.label xp = 4
|
||||
// *D011 = VIC_DEN | VIC_RSEL | 3
|
||||
|
@ -10,10 +10,8 @@
|
||||
// The VIC-II MOS 6567/6569
|
||||
.label VICII = $d000
|
||||
// Pointer to the music init routine
|
||||
// Pointer to the music init routine
|
||||
.label musicInit = MUSIC
|
||||
// Pointer to the music play routine
|
||||
// Pointer to the music play routine
|
||||
.label musicPlay = MUSIC+3
|
||||
// Play the music
|
||||
main: {
|
||||
|
@ -22,10 +22,8 @@
|
||||
// The vector used when the KERNAL serves IRQ interrupts
|
||||
.label KERNEL_IRQ = $314
|
||||
// Pointer to the music init routine
|
||||
// Pointer to the music init routine
|
||||
.label musicInit = MUSIC
|
||||
// Pointer to the music play routine
|
||||
// Pointer to the music play routine
|
||||
.label musicPlay = MUSIC+3
|
||||
// Raster IRQ Routine playing music
|
||||
irq_play: {
|
||||
|
@ -81,10 +81,8 @@
|
||||
// Pointer to the start of RAM memory
|
||||
.label MEMORY = 0
|
||||
// NES Picture Processing Unit (PPU)
|
||||
// NES Picture Processing Unit (PPU)
|
||||
.label PPU = $2000
|
||||
// NES CPU and audion processing unit (APU)
|
||||
// NES CPU and audion processing unit (APU)
|
||||
.label APU = $4000
|
||||
// The current cursor x-position
|
||||
.label conio_cursor_x = $11
|
||||
@ -366,7 +364,6 @@ cputln: {
|
||||
}
|
||||
// Scroll the entire screen if the cursor is beyond the last line
|
||||
cscroll: {
|
||||
// Scroll lines up
|
||||
// Scroll lines up
|
||||
.label line1 = $17
|
||||
.label line2 = $f
|
||||
@ -460,7 +457,6 @@ cscroll: {
|
||||
// ppuDataTransfer(void* zp(5) ppuData, void* zp(7) cpuData, word zp(9) size)
|
||||
ppuDataTransfer: {
|
||||
.label ppuDataPrepare1_ppuData = 5
|
||||
// Transfer to PPU
|
||||
.label cpuSrc = 7
|
||||
.label i = $b
|
||||
.label ppuData = 5
|
||||
@ -516,7 +512,6 @@ ppuDataFetch: {
|
||||
.const size = $20
|
||||
.label cpuData = conio_cscroll_buffer
|
||||
// Fetch from PPU to CPU
|
||||
// Fetch from PPU to CPU
|
||||
.label cpuDst = 7
|
||||
.label i = 5
|
||||
.label ppuData = $19
|
||||
|
@ -82,10 +82,8 @@
|
||||
// Pointer to the start of RAM memory
|
||||
.label MEMORY = 0
|
||||
// NES Picture Processing Unit (PPU)
|
||||
// NES Picture Processing Unit (PPU)
|
||||
.label PPU = $2000
|
||||
// NES CPU and audion processing unit (APU)
|
||||
// NES CPU and audion processing unit (APU)
|
||||
.label APU = $4000
|
||||
.segment Code
|
||||
// NMI Called when the PPU refreshes the screen (also known as the V-Blank period)
|
||||
@ -501,7 +499,6 @@ ppuDataTransfer: {
|
||||
.label ppuData = PPU_PALETTE
|
||||
.label cpuData = PALETTE
|
||||
// Transfer to PPU
|
||||
// Transfer to PPU
|
||||
.label cpuSrc = 6
|
||||
.label i = 4
|
||||
// PPU->PPUADDR = >ppuData
|
||||
|
@ -74,10 +74,8 @@
|
||||
// Pointer to the start of RAM memory
|
||||
.label MEMORY = 0
|
||||
// NES Picture Processing Unit (PPU)
|
||||
// NES Picture Processing Unit (PPU)
|
||||
.label PPU = $2000
|
||||
// NES CPU and audion processing unit (APU)
|
||||
// NES CPU and audion processing unit (APU)
|
||||
.label APU = $4000
|
||||
// Index into the Y sine
|
||||
.label y_sin_idx = $c
|
||||
@ -266,7 +264,6 @@ ppuDataTransfer: {
|
||||
.label ppuData = PPU_PALETTE
|
||||
.label cpuData = PALETTE
|
||||
// Transfer to PPU
|
||||
// Transfer to PPU
|
||||
.label cpuSrc = 6
|
||||
.label i = 4
|
||||
// PPU->PPUADDR = >ppuData
|
||||
@ -319,7 +316,6 @@ vblank: {
|
||||
.label __23 = $b
|
||||
.label __25 = $b
|
||||
.label __28 = $f
|
||||
// Update sprite positions
|
||||
.label y_idx = 9
|
||||
.label x_idx = $a
|
||||
.label x_idx_2 = $b
|
||||
|
@ -48,19 +48,14 @@ anim: {
|
||||
.label __12 = 3
|
||||
.label __26 = $13
|
||||
.label x = $b
|
||||
// signed fixed[7.0]
|
||||
.label y = $c
|
||||
.label xr = $d
|
||||
// signed fixed[8.8]
|
||||
.label yr = $f
|
||||
// signed fixed[8.8]
|
||||
.label xpos = $11
|
||||
// signed fixed[0.7]
|
||||
// signed fixed[0.7]
|
||||
.label sprite_msb = 2
|
||||
.label i = $a
|
||||
.label angle = 7
|
||||
// Calculate the cycle count - 0x12 is the base usage of start/read
|
||||
.label cyclecount = $13
|
||||
lda #0
|
||||
sta.z angle
|
||||
@ -475,22 +470,17 @@ init: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = 7
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = 8
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $11
|
||||
.label sqr1_lo = 5
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $f
|
||||
.label sqr2_lo = $d
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $a
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -323,14 +323,10 @@ sin16s_gen2: {
|
||||
.label ampl = max-min
|
||||
.label __6 = 8
|
||||
.label __8 = $1d
|
||||
// ampl is always positive so shifting left does not alter the sign
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $19
|
||||
.label sintab = $14
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = 4
|
||||
.label i = $27
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -534,23 +530,14 @@ sin16s: {
|
||||
.label __4 = $1f
|
||||
.label x = $c
|
||||
.label return = $12
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $23
|
||||
// u[1.15]
|
||||
.label x2 = $16
|
||||
// u[2.14] x^2
|
||||
.label x3 = $16
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $25
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $12
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $16
|
||||
// u[3.13] x^4
|
||||
.label x5 = $25
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $25
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $12
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
|
@ -282,14 +282,10 @@ sin16s_gen2: {
|
||||
.label ampl = max-min
|
||||
.label __6 = 8
|
||||
.label __8 = $1c
|
||||
// ampl is always positive so shifting left does not alter the sign
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $18
|
||||
.label sintab = 6
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = 2
|
||||
.label i = $14
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -493,23 +489,14 @@ sin16s: {
|
||||
.label __4 = $1e
|
||||
.label x = $e
|
||||
.label return = $1c
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $22
|
||||
// u[1.15]
|
||||
.label x2 = $12
|
||||
// u[2.14] x^2
|
||||
.label x3 = $12
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $24
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $1c
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $12
|
||||
// u[3.13] x^4
|
||||
.label x5 = $24
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $24
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $1c
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
|
@ -250,7 +250,6 @@ clear_screen: {
|
||||
// - max is the maximum value of the generated sinus
|
||||
// gen_sintab(byte* zp($f) sintab, byte zp(8) length, byte zp(6) min, byte register(X) max)
|
||||
gen_sintab: {
|
||||
// amplitude/2
|
||||
// amplitude/2
|
||||
.label f_2pi = $e2e5
|
||||
.label __20 = $13
|
||||
@ -624,15 +623,12 @@ gen_chargen_sprite: {
|
||||
.label __14 = $13
|
||||
.label sprite = $f
|
||||
.label chargen = $13
|
||||
// current chargen line
|
||||
.label bits = 5
|
||||
// current sprite char
|
||||
// current sprite char
|
||||
.label s_gen = 9
|
||||
.label x = 6
|
||||
.label y = 4
|
||||
// Find the current chargen pixel (c)
|
||||
// Find the current chargen pixel (c)
|
||||
.label c = 8
|
||||
// ((unsigned int)ch)*8
|
||||
txa
|
||||
|
@ -29,7 +29,6 @@ zpLoop: {
|
||||
}
|
||||
.segment Code
|
||||
main: {
|
||||
// Transfer ZP-code to zeropage
|
||||
// Transfer ZP-code to zeropage
|
||||
.label zpCode = zpLoop
|
||||
// asm
|
||||
|
@ -3,7 +3,6 @@
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
main: {
|
||||
// Count the number of the different chars on the screen
|
||||
// Count the number of the different chars on the screen
|
||||
.label screen = 2
|
||||
.label i = 4
|
||||
|
@ -2,7 +2,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(_start)
|
||||
.pc = $80d "Program"
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
.label BYTES = malloc.return
|
||||
|
@ -4,7 +4,6 @@
|
||||
.pc = $80d "Program"
|
||||
.const SIZEOF_WORD = 2
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
.label WORDS = malloc.return
|
||||
_start: {
|
||||
|
@ -4,7 +4,6 @@
|
||||
.pc = $80d "Program"
|
||||
.label SCREEN = $400
|
||||
main: {
|
||||
// Working memory copy of string
|
||||
// Working memory copy of string
|
||||
.label sc = 4
|
||||
.label camelot = 2
|
||||
|
@ -2,7 +2,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
// Head of the heap. Moved backward each malloc()
|
||||
|
@ -232,22 +232,17 @@ mulf16u: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = 4
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = 5
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $c
|
||||
.label sqr1_lo = 2
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = 9
|
||||
.label sqr2_lo = 7
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $b
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -75,7 +75,6 @@ main: {
|
||||
}
|
||||
// The raster loop
|
||||
loop: {
|
||||
// The current index into the y-sinus
|
||||
// The current index into the y-sinus
|
||||
.label sin_idx = 2
|
||||
lda #0
|
||||
@ -196,7 +195,6 @@ plexSort: {
|
||||
}
|
||||
// Initialize the program
|
||||
init: {
|
||||
// Set the x-positions & pointers
|
||||
// Set the x-positions & pointers
|
||||
.label xp = 4
|
||||
// *D011 = VIC_DEN | VIC_RSEL | 3
|
||||
|
@ -26,7 +26,6 @@
|
||||
// Plasma screen 2
|
||||
.label SCREEN2 = $2c00
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
.label print_screen = $400
|
||||
// Head of the heap. Moved backward each malloc()
|
||||
@ -543,7 +542,6 @@ atan2_16: {
|
||||
.label yi = 7
|
||||
.label xi = $1a
|
||||
.label angle = $10
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = 9
|
||||
.label yd = $18
|
||||
.label return = $10
|
||||
|
@ -11,7 +11,6 @@
|
||||
.label cpc1 = $400
|
||||
.label cpc2 = $400
|
||||
// Pointer to const
|
||||
// Pointer to const
|
||||
.label pc0 = $400
|
||||
.label pc1 = $400
|
||||
.label pc2 = $400
|
||||
|
@ -38,7 +38,6 @@ main: {
|
||||
inx
|
||||
jmp __b1
|
||||
}
|
||||
// Pointer to const
|
||||
// Pointer to const
|
||||
MSG: .text "hello world!"
|
||||
.byte 0
|
||||
|
@ -3,8 +3,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// Test the preprocessor
|
||||
// #define inside an #included file
|
||||
// Test the preprocessor
|
||||
// #define inside an #included file
|
||||
.label SCREEN = $400
|
||||
|
@ -847,7 +847,6 @@ printf_slong: {
|
||||
.const format_upper_case = 0
|
||||
.const value = -main.sl
|
||||
// Format number into buffer
|
||||
// Format number into buffer
|
||||
.const uvalue = value
|
||||
// printf_buffer.sign = 0
|
||||
// Handle any sign
|
||||
@ -1097,7 +1096,6 @@ printf_sint: {
|
||||
.const format_upper_case = 0
|
||||
.const value = -main.si
|
||||
// Format number into buffer
|
||||
// Format number into buffer
|
||||
.const uvalue = value
|
||||
// printf_buffer.sign = 0
|
||||
// Handle any sign
|
||||
@ -1265,7 +1263,6 @@ printf_schar: {
|
||||
.const format_upper_case = 0
|
||||
.const value = -main.sc
|
||||
// Format number into buffer
|
||||
// Format number into buffer
|
||||
.const uvalue = value
|
||||
// printf_buffer.sign = 0
|
||||
// Handle any sign
|
||||
|
@ -3,13 +3,10 @@
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
main: {
|
||||
// RValue pointer expression (constant)
|
||||
// RValue pointer expression (constant)
|
||||
.label screen = $400
|
||||
// Increment on a const named pointer
|
||||
// Increment on a const named pointer
|
||||
.label BG_COLOR = $d020
|
||||
// LValue pointer expression (constant - through tmp variable)
|
||||
.label sc2 = screen+$51
|
||||
ldx #0
|
||||
// RValue pointer expression (variable)
|
||||
|
@ -15,7 +15,6 @@ main: {
|
||||
rts
|
||||
}
|
||||
lvaluevar: {
|
||||
// LValue Variable pointer dereference
|
||||
// LValue Variable pointer dereference
|
||||
.const b = 4
|
||||
.label screen = 2
|
||||
|
@ -286,7 +286,6 @@ myprintf: {
|
||||
.label bDigits = $d
|
||||
.label bLen = $e
|
||||
// formats
|
||||
// formats
|
||||
.label b = $c
|
||||
.label bArg = 9
|
||||
.label w1 = 2
|
||||
|
@ -309,7 +309,6 @@ atan2_16: {
|
||||
.label yi = 6
|
||||
.label xi = $a
|
||||
.label angle = $d
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = 8
|
||||
.label yd = $f
|
||||
.label return = $d
|
||||
|
@ -22,7 +22,6 @@
|
||||
.label CHARSET = $2000
|
||||
.label SCREEN = $2800
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
// Squares for each char value SQUARES[i] = i*i
|
||||
// Initialized by init_squares()
|
||||
|
@ -21,7 +21,6 @@
|
||||
// Screen containing angle to center
|
||||
.label SCREEN_FILL = $400
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
// Head of the heap. Moved backward each malloc()
|
||||
.label heap_head = 4
|
||||
@ -106,15 +105,12 @@ main: {
|
||||
.label bucket = $16
|
||||
.label bucket_size = $18
|
||||
// Animate a spiral walking through the buckets one at a time
|
||||
// Animate a spiral walking through the buckets one at a time
|
||||
.label bucket_idx = 2
|
||||
.label offset = $14
|
||||
.label fill = $19
|
||||
.label angle = $1b
|
||||
// Find the minimum unfilled angle in the current bucket
|
||||
// Find the minimum unfilled angle in the current bucket
|
||||
.label min_angle = 3
|
||||
// Found something to fill!
|
||||
.label fill1 = 4
|
||||
.label min_offset = 4
|
||||
.label min_offset_1 = $14
|
||||
@ -281,13 +277,11 @@ init_buckets: {
|
||||
.label __12 = $1d
|
||||
.label __14 = $1d
|
||||
.label screen = $1b
|
||||
// first find bucket sizes - by counting number of chars with each distance value
|
||||
.label dist = $c
|
||||
.label i1 = $16
|
||||
.label i2 = $19
|
||||
.label distance = $1f
|
||||
.label bucket = $1d
|
||||
// first find bucket sizes - by counting number of chars with each distance value
|
||||
.label dist_1 = $22
|
||||
.label i4 = $24
|
||||
.label __15 = 6
|
||||
@ -630,7 +624,6 @@ atan2_16: {
|
||||
.label yi = $19
|
||||
.label xi = $22
|
||||
.label angle = $24
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = 8
|
||||
.label yd = 6
|
||||
.label return = $24
|
||||
|
@ -12,7 +12,6 @@
|
||||
// Screen containing angle to center
|
||||
.label SCREEN_FILL = $400
|
||||
// Top of the heap used by malloc()
|
||||
// Top of the heap used by malloc()
|
||||
.label HEAP_TOP = $a000
|
||||
// Head of the heap. Moved backward each malloc()
|
||||
.label heap_head = $15
|
||||
@ -53,7 +52,6 @@ _start: {
|
||||
rts
|
||||
}
|
||||
main: {
|
||||
// Find the minimum dist/angle that is not already filled
|
||||
.label dist = 2
|
||||
.label angle = 4
|
||||
.label fill = $15
|
||||
@ -316,7 +314,6 @@ atan2_16: {
|
||||
.label yi = $11
|
||||
.label xi = $24
|
||||
.label angle = $13
|
||||
// Optimized shift of 2 values: xd=xi>>i; yd=yi>>i
|
||||
.label xd = $1e
|
||||
.label yd = $17
|
||||
.label return = $13
|
||||
|
@ -8,14 +8,12 @@
|
||||
.const SQRT_COUNT = $80
|
||||
.label SCREEN = $400
|
||||
/* Sqrt of COUNT */
|
||||
/* Sqrt of COUNT */
|
||||
.label sieve = $1000
|
||||
.label print_screen = $400
|
||||
.label print_char_cursor = $a
|
||||
main: {
|
||||
.label i = $a
|
||||
.label sieve_i = 2
|
||||
/* Prime number - mark all multiples */
|
||||
.label j = 6
|
||||
.label s = 8
|
||||
.label i_1 = 4
|
||||
|
@ -28,7 +28,6 @@
|
||||
.label CIA2_TIMER_AB = $dd04
|
||||
.label SCREEN = $400
|
||||
/* Sqrt of COUNT */
|
||||
/* Sqrt of COUNT */
|
||||
.label sieve = $1000
|
||||
.label print_screen = $400
|
||||
// Remainder after unsigned 16-bit division
|
||||
@ -45,7 +44,6 @@ main: {
|
||||
.label sec100s = 4
|
||||
.label i = $a
|
||||
.label sieve_i = 2
|
||||
/* Prime number - mark all multiples */
|
||||
.label j = 6
|
||||
.label s = 8
|
||||
.label i_1 = 4
|
||||
|
@ -235,13 +235,10 @@ memset: {
|
||||
// sin16s_gen(signed word* zp($c) sintab)
|
||||
sin16s_gen: {
|
||||
.label __2 = $12
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $1c
|
||||
.label sintab = $c
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = 8
|
||||
.label i = 6
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -330,23 +327,14 @@ sin16s: {
|
||||
.label __4 = $20
|
||||
.label x = $e
|
||||
.label return = $12
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $26
|
||||
// u[1.15]
|
||||
.label x2 = $18
|
||||
// u[2.14] x^2
|
||||
.label x3 = $18
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $24
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $12
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $18
|
||||
// u[3.13] x^4
|
||||
.label x5 = $24
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $24
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $12
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
|
@ -255,13 +255,10 @@ memset: {
|
||||
// sin16s_genb(signed word* zp($f) sintab)
|
||||
sin16s_genb: {
|
||||
.label __3 = $15
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $1d
|
||||
.label sintab = $f
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = $11
|
||||
.label i = $1b
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -345,23 +342,14 @@ sin16s_genb: {
|
||||
sin16sb: {
|
||||
.label x = 9
|
||||
.label return = $15
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = 9
|
||||
// u[1.15]
|
||||
.label x2 = $b
|
||||
// u[2.14] x^2
|
||||
.label x3 = $b
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $21
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $15
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $b
|
||||
// u[3.13] x^4
|
||||
.label x5 = $21
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $21
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $15
|
||||
// if(x >= PI_u4f12 )
|
||||
lda.z x+1
|
||||
@ -722,13 +710,10 @@ divr16u: {
|
||||
// sin16s_gen(signed word* zp($15) sintab)
|
||||
sin16s_gen: {
|
||||
.label __2 = $1b
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $1d
|
||||
.label sintab = $15
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = $11
|
||||
.label i = $f
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -817,23 +802,14 @@ sin16s: {
|
||||
.label __4 = $23
|
||||
.label x = $17
|
||||
.label return = $1b
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $27
|
||||
// u[1.15]
|
||||
.label x2 = $b
|
||||
// u[2.14] x^2
|
||||
.label x3 = $b
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $21
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $1b
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $b
|
||||
// u[3.13] x^4
|
||||
.label x5 = $21
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $21
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $1b
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
|
@ -184,13 +184,10 @@ memset: {
|
||||
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
|
||||
// sin8s_gen(signed byte* zp(7) sintab)
|
||||
sin8s_gen: {
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $f
|
||||
.label sintab = 7
|
||||
// u[4.12]
|
||||
// Iterate over the table
|
||||
// u[4.12]
|
||||
// Iterate over the table
|
||||
.label x = 5
|
||||
.label i = 3
|
||||
// div16u(PI2_u4f12, wavelength)
|
||||
@ -258,14 +255,10 @@ sin8s: {
|
||||
.const DIV_6 = $2b
|
||||
.label __4 = $b
|
||||
.label x = $b
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $11
|
||||
// u[2.6] x^2
|
||||
.label x3 = $12
|
||||
// u[1.7] x^3/6;
|
||||
.label usinx = $13
|
||||
// Move x1 into the range 0-PI/2 using sinus mirror symmetries
|
||||
// Move x1 into the range 0-PI/2 using sinus mirror symmetries
|
||||
.label isUpper = 9
|
||||
// if(x >= PI_u4f12 )
|
||||
lda.z x+1
|
||||
|
@ -231,13 +231,10 @@ memset: {
|
||||
// sin16s_gen(signed word* zp($15) sintab)
|
||||
sin16s_gen: {
|
||||
.label __2 = $17
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $1d
|
||||
.label sintab = $15
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
// u[4.28]
|
||||
// Iterate over the table
|
||||
.label x = 5
|
||||
.label i = 3
|
||||
// div32u16u(PI2_u4f28, wavelength)
|
||||
@ -326,23 +323,14 @@ sin16s: {
|
||||
.label __4 = $21
|
||||
.label x = 9
|
||||
.label return = $17
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $25
|
||||
// u[1.15]
|
||||
.label x2 = $11
|
||||
// u[2.14] x^2
|
||||
.label x3 = $11
|
||||
// u[2.14] x^3
|
||||
.label x3_6 = $27
|
||||
// u[1.15] x^3/6;
|
||||
.label usinx = $17
|
||||
// u[1.15] x - x^3/6
|
||||
.label x4 = $11
|
||||
// u[3.13] x^4
|
||||
.label x5 = $27
|
||||
// u[4.12] x^5
|
||||
.label x5_128 = $27
|
||||
// u[1.15] (first bit is always zero)
|
||||
.label sinx = $17
|
||||
// if(x >= PI_u4f28 )
|
||||
lda.z x+3
|
||||
@ -749,13 +737,10 @@ divr16u: {
|
||||
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
|
||||
// sin8s_gen(signed byte* zp($1b) sintab)
|
||||
sin8s_gen: {
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $13
|
||||
.label sintab = $1b
|
||||
// u[4.12]
|
||||
// Iterate over the table
|
||||
// u[4.12]
|
||||
// Iterate over the table
|
||||
.label x = $17
|
||||
.label i = $15
|
||||
// div16u(PI2_u4f12, wavelength)
|
||||
@ -823,14 +808,10 @@ sin8s: {
|
||||
.const DIV_6 = $2b
|
||||
.label __4 = $25
|
||||
.label x = $25
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $2b
|
||||
// u[2.6] x^2
|
||||
.label x3 = $2c
|
||||
// u[1.7] x^3/6;
|
||||
.label usinx = $2d
|
||||
// Move x1 into the range 0-PI/2 using sinus mirror symmetries
|
||||
// Move x1 into the range 0-PI/2 using sinus mirror symmetries
|
||||
.label isUpper = $1a
|
||||
// if(x >= PI_u4f12 )
|
||||
lda.z x+1
|
||||
|
@ -37,15 +37,12 @@ sin8u_table: {
|
||||
.const sum = min+max
|
||||
.const mid = sum/2+1
|
||||
.label amplitude = max-min
|
||||
//if( sum & 1 > 0) mid++;
|
||||
// u[4.28] step = PI*2/wavelength
|
||||
.label step = $e
|
||||
.label sinx = $12
|
||||
.label sinx_sc = 6
|
||||
.label sinx_tr = $13
|
||||
.label sintab = 4
|
||||
// Iterate over the table
|
||||
// Iterate over the table
|
||||
.label x = 2
|
||||
.label i = $10
|
||||
// div16u(PI2_u4f12, tabsize)
|
||||
@ -471,14 +468,10 @@ sin8s: {
|
||||
.const DIV_6 = $2b
|
||||
.label __4 = $c
|
||||
.label x = $c
|
||||
// sinx = x - x^3/6 + x5/128;
|
||||
.label x1 = $14
|
||||
// u[2.6] x^2
|
||||
.label x3 = $15
|
||||
// u[1.7] x^3/6;
|
||||
.label usinx = $16
|
||||
// Move x1 into the range 0-PI/2 using sinus mirror symmetries
|
||||
// Move x1 into the range 0-PI/2 using sinus mirror symmetries
|
||||
.label isUpper = $12
|
||||
// if(x >= PI_u4f12 )
|
||||
lda.z x+1
|
||||
|
@ -9,10 +9,8 @@ main: {
|
||||
// Print points
|
||||
.label SCREEN = $400
|
||||
// Fill points
|
||||
// Fill points
|
||||
.label points = 2
|
||||
// Fill points
|
||||
// Fill points
|
||||
.label points_1 = 4
|
||||
.label i1 = 6
|
||||
ldx #0
|
||||
|
@ -4,7 +4,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// One of the bytes used for addition
|
||||
// One of the bytes used for addition
|
||||
.const a = 'a'
|
||||
// The C64 screen
|
||||
|
@ -3,7 +3,6 @@
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// One of the bytes used for addition
|
||||
// One of the bytes used for addition
|
||||
.const a = 'a'
|
||||
// The C64 screen
|
||||
|
@ -64,7 +64,6 @@ main: {
|
||||
.label row = 4
|
||||
.label ch = 7
|
||||
// Checks all specific chars $00-$3f
|
||||
// Checks all specific chars $00-$3f
|
||||
.label i = 8
|
||||
lda #<$400
|
||||
sta.z sc
|
||||
|
@ -1148,22 +1148,17 @@ muls16u: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = $16
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = $17
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $1c
|
||||
.label sqr1_lo = $14
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $20
|
||||
.label sqr2_lo = $19
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $1b
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -892,7 +892,6 @@ mulf_tables_cmp: {
|
||||
// Initialize the multiplication tables using ASM code from
|
||||
// http://codebase64.org/doku.php?id=base:seriously_fast_multiplication
|
||||
mulf_init_asm: {
|
||||
// Ensure the ASM tables are not detected as unused by the optimizer
|
||||
// Ensure the ASM tables are not detected as unused by the optimizer
|
||||
.label mem = $ff
|
||||
// asm
|
||||
@ -951,22 +950,17 @@ mulf_init_asm: {
|
||||
}
|
||||
// Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4)
|
||||
mulf_init: {
|
||||
// x/2
|
||||
// x/2
|
||||
.label c = $10
|
||||
// Counter used for determining x%2==0
|
||||
// Counter used for determining x%2==0
|
||||
.label sqr1_hi = 7
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
// Fill mulf_sqr1 = f(x) = int(x*x/4): If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
.label sqr = $e
|
||||
.label sqr1_lo = 5
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
// Decrease or increase x_255 - initially we decrease
|
||||
.label sqr2_hi = $b
|
||||
.label sqr2_lo = 9
|
||||
//Start with g(0)=f(255)
|
||||
//Start with g(0)=f(255)
|
||||
.label dir = $d
|
||||
ldx #0
|
||||
lda #<mulf_sqr1_hi+1
|
||||
|
@ -2,19 +2,14 @@
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
main: {
|
||||
// constant byte array
|
||||
// constant byte array
|
||||
.const b = 4
|
||||
// constant byte
|
||||
.const w = b*$100
|
||||
// constant inline word
|
||||
.const w2 = 1*$100+1+w
|
||||
// Test the result
|
||||
// Test the result
|
||||
.label pos = $501
|
||||
.label BG_COLOR = $d021
|
||||
// constant inline words inside expression
|
||||
// constant inline words inside expression
|
||||
.label sc = w2
|
||||
// *sc = bs[1]
|
||||
// implicit cast to (byte*)
|
||||
|
@ -4,7 +4,6 @@
|
||||
.pc = $80d "Program"
|
||||
.label SCREEN = $400
|
||||
main: {
|
||||
// used vars
|
||||
// used vars
|
||||
.const col = 2
|
||||
.label COLS = $d800
|
||||
|
@ -3,7 +3,6 @@
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
main: {
|
||||
// A local pointer
|
||||
.label screen = 2
|
||||
// screen = 0x0400
|
||||
// A local pointer
|
||||
|
@ -11,7 +11,6 @@ main: {
|
||||
rts
|
||||
}
|
||||
model_ssa_zp: {
|
||||
// A local pointer
|
||||
// A local pointer
|
||||
.label screen = 2
|
||||
ldx #0
|
||||
@ -69,7 +68,6 @@ model_ma_mem: {
|
||||
bne __b1
|
||||
// }
|
||||
rts
|
||||
// A local pointer
|
||||
screen: .word 0
|
||||
i: .byte 0
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ main: {
|
||||
bne __b1
|
||||
// }
|
||||
rts
|
||||
// A local pointer
|
||||
screen: .word 0
|
||||
i: .byte 0
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
.pc = $80d "Program"
|
||||
.const FILL = $e6
|
||||
// The total number of voronoi points
|
||||
// The total number of voronoi points
|
||||
.const numpoints = 6
|
||||
.label SCREEN = $400
|
||||
.label COLORS = $d800
|
||||
|
Loading…
x
Reference in New Issue
Block a user