Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Kick Assembler Thread 2
2009-07-21 17:20
Slammer

Registered: Feb 2004
Posts: 416
Kick Assembler Thread 2

The previous thread took a little long to load, so this is a new fresh one..
 
... 592 posts hidden. Click here to view all posts....
 
2010-04-13 13:11
JackAsser

Registered: Jun 2002
Posts: 1997
Quote: i just tried to post a few bugs again and the same error.

here are 2 bugs i've found tho,

1. Script

when using a Hashtable like this, .var pixelTable = Hashtable() and then using it in a loop generates this:

parsing
flex pass 1

.if (pixelTable.get(key) != null)
^
Error: Unknown function : !=



2. Reading bytes from binary files

when loading binary files like this, .var dataFile = LoadBinary("data\hiresvector\lightwave.obj")

and then reading it byte by byte using vectorFile.get(i) gives back random signs of the byte. it can be solved by doing vectorFile.get(i) & 255 so it seems kickasm is reading 32 bits and gives back 8 without clearing the other 24 bits or something.

-Pantaloon


Due to Java's lack of unsigned data types a byte read from a file is always signed. When converted to an int, it's properly sign extended, and as you say, to read unsigned in Java one has to convert the byte into a larger data type, say short or int, then mask the lower 8 bits via the "and 0xff".

Would ofcourse be nice if KickAss did that for you, or assume unsigned always and add some .getSigned(i) or even .get<DataType>(i).
2010-04-13 14:09
Slammer

Registered: Feb 2004
Posts: 416
Jackasser is right. Javas byte primitive is signed and ranges from -128 to 127. I will se if I can make you an unsigned getter.

The != function should be defined for the most common object types. What objects have you stored in the table?

2010-04-13 14:22
Pantaloon

Registered: Aug 2003
Posts: 124
the hashtable entries contains a List that contains structs that are defined like this: .struct Pixel {addr,mask}
2010-04-13 14:28
Slammer

Registered: Feb 2004
Posts: 416
Ok, Here is a workaround. List hasn't got the != function right now. So use null!=pixelTable.get(key) which will call the != function on the null object instead.
2010-04-13 15:12
Pantaloon

Registered: Aug 2003
Posts: 124
thx :)
2010-05-21 00:49
TWW

Registered: Jul 2009
Posts: 542
Observe the folowing:

//------------------------------------------------------------------------ -------------------------------------------
//-Routine for pulling $d800 Collors.
//------------------------------------------------------------------------------ -------------------------------------
.pc = * "Collor Puller Routine"
.label coll1 = CollPull
.label coll2 = CollPull+235
.label coll3 = CollPull+235*2
.label coll4 = CollPull+235*3
.label coll5 = CollPull+235*4
.label coll6 = CollPull+235*5
.label coll7 = CollPull+235*6
.label coll8 = CollPull+235*7
.label coll9 = CollPull+235*8
.label coll10 = CollPull+235*9
.label coll11 = CollPull+235*10
.label coll12 = CollPull+235*11
.label coll13 = CollPull+235*12
.label coll14 = CollPull+235*13
.label coll15 = CollPull+235*14
.label coll16 = CollPull+235*15
.label coll17 = CollPull+235*16
.label coll18 = CollPull+235*17
.label coll19 = CollPull+235*18
.label coll20 = CollPull+235*19
.label coll21 = CollPull+235*20
.label coll22 = CollPull+235*21
.label coll23 = CollPull+235*22
.label coll24 = CollPull+235*23
.label coll25 = CollPull+235*24
CollPull:
    .for (y=0;y<25;y++) {
        .for (x=0;x<39;x++) {
            lda $d801+x+[y*40]
            sta $d800+x+[y*40]
        }
        rts
    }
//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-


This allowes me to jsr collN for any of the 25 lines i need. My question is; Is there some more fancysmancy way of handling the labels in this case (Include it in the loop f.ex) something like this:

    .for (y=0;y<25;y++) {
.label "coll"+toIntString(y+1)
        .for (x=0;x<39;x++) {
            lda $d801+x+[y*40]
            sta $d800+x+[y*40]
        }
        rts
    }


and then be able to jsr coll5 f.ex. outside the scope?

If not can I use the .label in conjunction with list() to generate the label list?
2010-05-21 04:08
Oswald

Registered: Apr 2002
Posts: 5034
fancymansy way in graham ass (took 5 minutes):

*= $1000

x = $f0
y = $f1

speedcode = $4000
labelslo = $c000
labelshi = $c028

sei

jsr makespeed

ldx column
lda labelslo,x
sta self+1
lda labelshi,x
sta self+2

self jsr speedcode

jmp *

makespeed
lda #0
sta x
sta y

lda #<speedcode
sta $fc
lda #>speedcode
sta $fd

loop2

ldx x
lda $fc
sta labelslo,x
lda $fd
sta labelshi,x

loop1

lda y
asl
tay
lda mul40,y
clc
adc x
sta $fa
lda mul40+1,y
adc #>$d800
sta $fb

ldy #$00 ;lda $d801
lda c0
sta ($fc),y
iny
lda $fa
clc
adc #$01
sta ($fc),y
iny
lda $fb
adc #$00
sta ($fc),y
iny

lda c1 ;sta $d800
sta ($fc),y
iny
lda $fa
sta ($fc),y
iny
lda $fb
sta ($fc),y
iny

tya
clc
adc $fc
sta $fc
bcc *+4
inc $fd

inc y
lda y
cmp #25
bne loop1

ldy #$00
lda #$60
sta ($fc),y ; rts

inc $fc
bne *+4
inc $fd

lda #0
sta y

inc x
lda x
cmp #40
bne loop2

rts

c0 lda $d800
c1 sta $d800

mul40 .word 0,40,80,120,160,200,240,280,320,360,400,440,480,520,560,600,640,680,720,760,800, 840,880,920,960
2010-05-21 07:14
Pantaloon

Registered: Aug 2003
Posts: 124
.pc = * "Collor Puller Routine" CollPull:

.var l = List()

.for (y=0;y<25;y++)
{
.eval l = l.add(*)
.for (x=0;x<39;x++)
{
lda $d801+x+[y*40]
sta $d800+x+[y*40]
}
rts

}


lotable:
.fill l.size(), <l.get(i)

hitable:
.fill l.size(), >l.get(i)


and use like this

// y contains the row
ldy #$00
lda lotable,y
sta jsra+1
lda hitable,y
sta jsra+2
jsra: jsr $0000

or from script

jsr l.get(0)
2010-05-21 09:31
Pantaloon

Registered: Aug 2003
Posts: 124
Slammer:

Would it be possible to add a new script command in kickasm, something like this:

.var data = .system "myprog.exe " + cmdlineString

so it's possible to call an external program while kickasm is doing the scriptjob ?
2010-05-21 13:01
Slammer

Registered: Feb 2004
Posts: 416
Yep, absolutely. One of the long term goals of creating v3 was making an architecture that made things like this possible. However, im a bit busy at the moment so don't expect it soon.

Previous - 1 | ... | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | ... | 61 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
CA$H/TRiAD
Scrap/Genesis Project
Mason/Unicess
TheRyk/MYD!
Nordischsound/Hokuto..
Murphy/Exceed
Martin Piper
Jammer
Meikel aka ZUX/Sparks
Guests online: 83
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Uncensored  (9.6)
7 Comaland 100%  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Morph  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.058 sec.