added some preliminary clobber specs to some cx16 graphics calls, This fixes the 3d cube gfx

This commit is contained in:
Irmen de Jong 2020-09-07 04:06:46 +02:00
parent e19de0901e
commit 02e29e6990
3 changed files with 11 additions and 8 deletions

View File

@ -192,11 +192,12 @@ romsub $ff4d = clock_set_date_time() clobbers(A, X, Y) ; args: r0, r1, r2,
romsub $ff50 = clock_get_date_time() clobbers(A) ; outout args: r0, r1, r2, r3L
; high level graphics & fonts
romsub $ff20 = GRAPH_init() ; uses vectors=r0
romsub $ff23 = GRAPH_clear()
; TODO specify the correct clobbers for GRAPH and FB functions
romsub $ff20 = GRAPH_init() clobbers(A,X,Y) ; uses vectors=r0
romsub $ff23 = GRAPH_clear() clobbers(A,X,Y)
romsub $ff26 = GRAPH_set_window() ; uses x=r0, y=r1, width=r2, height=r3
romsub $ff29 = GRAPH_set_colors(ubyte stroke @A, ubyte fill @X, ubyte background @Y)
romsub $ff2c = GRAPH_draw_line() ; uses x1=r0, y1=r1, x2=r2, y2=r3
romsub $ff29 = GRAPH_set_colors(ubyte stroke @A, ubyte fill @X, ubyte background @Y) clobbers (A,X,Y)
romsub $ff2c = GRAPH_draw_line() clobbers(A,X,Y) ; uses x1=r0, y1=r1, x2=r2, y2=r3
romsub $ff2f = GRAPH_draw_rect(ubyte fill @Pc) ; uses x=r0, y=r1, width=r2, height=r3, cornerradius=r4
romsub $ff32 = GRAPH_move_rect() ; uses sx=r0, sy=r1, tx=r2, ty=r3, width=r4, height=r5
romsub $ff35 = GRAPH_draw_oval(ubyte fill @Pc) ; uses x=r0, y=r1, width=r2, height=r3

View File

@ -31,9 +31,9 @@ main {
rotate_vertices(msb(anglex), msb(angley), msb(anglez))
cx16.GRAPH_clear()
draw_lines()
anglex-=250
angley+=109
anglez+=226
anglex-=500
angley+=217
anglez+=452
}
}
@ -84,7 +84,7 @@ main {
cx16.r1 = rotatedy[vFrom] / persp1 + screen_height/2 as uword
cx16.r2 = rotatedx[vTo] / persp2 + screen_width/2 as uword
cx16.r3 = rotatedy[vTo] / persp2 + screen_height/2 as uword
cx16.GRAPH_draw_line() ; TODO are there bugs in here? the lines are all wrong...
cx16.GRAPH_draw_line()
}
}
}

View File

@ -11,6 +11,8 @@ main {
c64.CHROUT('*')
uword value = lsb(rnd() & 31) ; TODO fix compiler crash
;asmsub clear_screen (ubyte char @ A, ubyte color @ Y) clobbers(A) { ...}
; TODO dont cause name conflict if we define sub or sub with param 'color' or even a var 'color' later.