mirror of
https://github.com/irmen/prog8.git
synced 2024-10-17 10:24:55 +00:00
version 4.1
This commit is contained in:
parent
2b35498370
commit
809917f13b
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
; bitmap pixel graphics module for the C64
|
; bitmap pixel graphics module for the C64
|
||||||
; only black/white monchrome for now
|
; only black/white monchrome for now
|
||||||
; assumes bitmap screen memory is $2000-$3fff
|
; assumes bitmap screen memory is $2000-$3fff
|
||||||
|
|
||||||
graphics {
|
graphics {
|
||||||
const uword bitmap_address = $2000
|
const uword bitmap_address = $2000
|
||||||
@ -228,36 +228,13 @@ _ormask .byte 128, 64, 32, 16, 8, 4, 2, 1
|
|||||||
; note: this can be even faster if we also have a 256 byte x-lookup table, but hey.
|
; note: this can be even faster if we also have a 256 byte x-lookup table, but hey.
|
||||||
; see http://codebase64.org/doku.php?id=base:various_techniques_to_calculate_adresses_fast_common_screen_formats_for_pixel_graphics
|
; see http://codebase64.org/doku.php?id=base:various_techniques_to_calculate_adresses_fast_common_screen_formats_for_pixel_graphics
|
||||||
; the y lookup tables encodes this formula: bitmap_address + 320*(py>>3) + (py & 7) (y from 0..199)
|
; the y lookup tables encodes this formula: bitmap_address + 320*(py>>3) + (py & 7) (y from 0..199)
|
||||||
; TODO can we use an assembler function for this to calc this at assembly-time?
|
; We use the 64tass syntax for range expressions to calculate this table on assembly time.
|
||||||
_y_lookup_hi
|
|
||||||
.byte $20, $20, $20, $20, $20, $20, $20, $20, $21, $21, $21, $21, $21, $21, $21, $21
|
_plot_y_values := $2000 + 320*(range(200)>>3) + (range(200) & 7)
|
||||||
.byte $22, $22, $22, $22, $22, $22, $22, $22, $23, $23, $23, $23, $23, $23, $23, $23
|
|
||||||
.byte $25, $25, $25, $25, $25, $25, $25, $25, $26, $26, $26, $26, $26, $26, $26, $26
|
_y_lookup_lo .byte <_plot_y_values
|
||||||
.byte $27, $27, $27, $27, $27, $27, $27, $27, $28, $28, $28, $28, $28, $28, $28, $28
|
_y_lookup_hi .byte >_plot_y_values
|
||||||
.byte $2a, $2a, $2a, $2a, $2a, $2a, $2a, $2a, $2b, $2b, $2b, $2b, $2b, $2b, $2b, $2b
|
|
||||||
.byte $2c, $2c, $2c, $2c, $2c, $2c, $2c, $2c, $2d, $2d, $2d, $2d, $2d, $2d, $2d, $2d
|
|
||||||
.byte $2f, $2f, $2f, $2f, $2f, $2f, $2f, $2f, $30, $30, $30, $30, $30, $30, $30, $30
|
|
||||||
.byte $31, $31, $31, $31, $31, $31, $31, $31, $32, $32, $32, $32, $32, $32, $32, $32
|
|
||||||
.byte $34, $34, $34, $34, $34, $34, $34, $34, $35, $35, $35, $35, $35, $35, $35, $35
|
|
||||||
.byte $36, $36, $36, $36, $36, $36, $36, $36, $37, $37, $37, $37, $37, $37, $37, $37
|
|
||||||
.byte $39, $39, $39, $39, $39, $39, $39, $39, $3a, $3a, $3a, $3a, $3a, $3a, $3a, $3a
|
|
||||||
.byte $3b, $3b, $3b, $3b, $3b, $3b, $3b, $3b, $3c, $3c, $3c, $3c, $3c, $3c, $3c, $3c
|
|
||||||
.byte $3e, $3e, $3e, $3e, $3e, $3e, $3e, $3e
|
|
||||||
|
|
||||||
_y_lookup_lo
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07, $40, $41, $42, $43, $44, $45, $46, $47
|
|
||||||
.byte $80, $81, $82, $83, $84, $85, $86, $87, $c0, $c1, $c2, $c3, $c4, $c5, $c6, $c7
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07, $40, $41, $42, $43, $44, $45, $46, $47
|
|
||||||
.byte $80, $81, $82, $83, $84, $85, $86, $87, $c0, $c1, $c2, $c3, $c4, $c5, $c6, $c7
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07, $40, $41, $42, $43, $44, $45, $46, $47
|
|
||||||
.byte $80, $81, $82, $83, $84, $85, $86, $87, $c0, $c1, $c2, $c3, $c4, $c5, $c6, $c7
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07, $40, $41, $42, $43, $44, $45, $46, $47
|
|
||||||
.byte $80, $81, $82, $83, $84, $85, $86, $87, $c0, $c1, $c2, $c3, $c4, $c5, $c6, $c7
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07, $40, $41, $42, $43, $44, $45, $46, $47
|
|
||||||
.byte $80, $81, $82, $83, $84, $85, $86, $87, $c0, $c1, $c2, $c3, $c4, $c5, $c6, $c7
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07, $40, $41, $42, $43, $44, $45, $46, $47
|
|
||||||
.byte $80, $81, $82, $83, $84, $85, $86, $87, $c0, $c1, $c2, $c3, $c4, $c5, $c6, $c7
|
|
||||||
.byte $00, $01, $02, $03, $04, $05, $06, $07
|
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
4.1-SNAPSHOT
|
4.1
|
||||||
|
@ -126,7 +126,7 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
|||||||
ident != null -> inplaceModification_word_variable_to_variable(target.asmVarname, target.datatype, operator, ident)
|
ident != null -> inplaceModification_word_variable_to_variable(target.asmVarname, target.datatype, operator, ident)
|
||||||
// TODO more specialized code for types such as memory read etc.
|
// TODO more specialized code for types such as memory read etc.
|
||||||
// value is DirectMemoryRead -> {
|
// value is DirectMemoryRead -> {
|
||||||
// println("warning: slow stack evaluation used (8): $name $operator= ${value::class.simpleName} at ${value.position}") // TODO
|
// println("warning: slow stack evaluation used (8): $name $operator= ${value::class.simpleName} at ${value.position}")
|
||||||
// // assignmentAsmGen.translateOtherAssignment(origAssign)
|
// // assignmentAsmGen.translateOtherAssignment(origAssign)
|
||||||
// asmgen.translateExpression(value.addressExpression)
|
// asmgen.translateExpression(value.addressExpression)
|
||||||
// asmgen.out("""
|
// asmgen.out("""
|
||||||
@ -135,7 +135,6 @@ internal class AugmentableAssignmentAsmGen(private val program: Program,
|
|||||||
// inx
|
// inx
|
||||||
// """)
|
// """)
|
||||||
// inplaceModification_word_value_to_variable(name, operator, )
|
// inplaceModification_word_value_to_variable(name, operator, )
|
||||||
// // TODO
|
|
||||||
// }
|
// }
|
||||||
value is TypecastExpression -> {
|
value is TypecastExpression -> {
|
||||||
if (tryRemoveRedundantCast(value, target, operator)) return
|
if (tryRemoveRedundantCast(value, target, operator)) return
|
||||||
|
110
examples/test.p8
110
examples/test.p8
@ -10,116 +10,6 @@ main {
|
|||||||
; sub color(...) {}
|
; sub color(...) {}
|
||||||
; sub other(ubyte color) {} ; TODO don't cause name conflict
|
; sub other(ubyte color) {} ; TODO don't cause name conflict
|
||||||
|
|
||||||
byte b1
|
|
||||||
byte b2
|
|
||||||
byte b3
|
|
||||||
|
|
||||||
word w1
|
|
||||||
word w2
|
|
||||||
word w3
|
|
||||||
|
|
||||||
|
|
||||||
b2 = 13
|
|
||||||
b3 = 100
|
|
||||||
b1 = b3 / b2
|
|
||||||
txt.print_b(b1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
b2 = -13
|
|
||||||
b3 = 100
|
|
||||||
b1 = b3 / b2
|
|
||||||
txt.print_b(b1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
b2 = 13
|
|
||||||
b3 = -100
|
|
||||||
b1 = b3 / b2
|
|
||||||
txt.print_b(b1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
b2 = -13
|
|
||||||
b3 = -100
|
|
||||||
b1 = b3 / b2
|
|
||||||
txt.print_b(b1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
|
|
||||||
b2 = 13
|
|
||||||
b3 = 100
|
|
||||||
b3 /= b2
|
|
||||||
txt.print_b(b3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
b2 = -13
|
|
||||||
b3 = 100
|
|
||||||
b3 /= b2
|
|
||||||
txt.print_b(b3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
b2 = 13
|
|
||||||
b3 = -100
|
|
||||||
b3 /= b2
|
|
||||||
txt.print_b(b3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
b2 = -13
|
|
||||||
b3 = -100
|
|
||||||
b3 /= b2
|
|
||||||
txt.print_b(b3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
w2 = 133
|
|
||||||
w3 = 20000
|
|
||||||
w1 = w3 / w2
|
|
||||||
txt.print_w(w1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
w2 = -133
|
|
||||||
w3 = 20000
|
|
||||||
w1 = w3 / w2
|
|
||||||
txt.print_w(w1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
w2 = 133
|
|
||||||
w3 = -20000
|
|
||||||
w1 = w3 / w2
|
|
||||||
txt.print_w(w1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
w2 = -133
|
|
||||||
w3 = -20000
|
|
||||||
w1 = w3 / w2
|
|
||||||
txt.print_w(w1)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
|
|
||||||
w2 = 133
|
|
||||||
w3 = 20000
|
|
||||||
w3 /= w2
|
|
||||||
txt.print_w(w3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
w2 = -133
|
|
||||||
w3 = 20000
|
|
||||||
w3 /= w2
|
|
||||||
txt.print_w(w3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
w2 = 133
|
|
||||||
w3 = -20000
|
|
||||||
w3 /= w2
|
|
||||||
txt.print_w(w3)
|
|
||||||
c64.CHROUT('\n')
|
|
||||||
|
|
||||||
w2 = -133
|
|
||||||
w3 = -20000
|
|
||||||
w3 /= w2
|
|
||||||
txt.print_w(w3)
|
|
||||||
c64.CHROUT('\n')
|
c64.CHROUT('\n')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user