tag:blogger.com,1999:blog-17487316.post4069543920183734588..comments2024-01-13T09:14:12.131+00:00Comments on The life of a Games Programmer: XeO3: Bloody bugs!!!Mikehttp://www.blogger.com/profile/15958965170878448339noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-17487316.post-62380485105302003242007-06-25T15:11:00.000+00:002007-06-25T15:11:00.000+00:00THATS IT!!Many thanks! I knew I was getting a bit...THATS IT!!<BR/><BR/>Many thanks! I knew I was getting a bit code-blind, and at work I'd usually call upon someone to act as a cardboard programmer to help me find it - but I cant do that at home. <BR/><BR/>And thanks to both you for the optimisations as well.Mikehttps://www.blogger.com/profile/15958965170878448339noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-81122435718074374402007-06-25T14:16:00.000+00:002007-06-25T14:16:00.000+00:00This is a severe case of "you see what you want to...This is a severe case of "you see what you want to see". Check the instruction after LAX, more specifically the address...<BR/><BR/>To make it bit faster, swap first/not_first order.<BR/><BR/>Lack of PRE tag will make this a mess, but is what I ended with:<BR/><BR/><BR/> ldx Cache_Next-1,y<BR/> beq .x ; last already!<BR/><BR/> lda Cache_Prev-1,y ; NEXT.prev = THIS.prev<BR/> sta Cache_Prev-1,x<BR/> <BR/>; We've now unlinked from the NEXT item, unlink from PREV item<BR/> <BR/> bne .notfirst<BR/><BR/> ldx Cache_Next-1,y ; FIRST = THIS.next<BR/> stx FirstCache<BR/> lda #$00 ; NEXT.prev = NULL<BR/> sta Cache_Prev-1,x<BR/> beq .end<BR/><BR/><B>.notfirst</B><BR/> tax ; = PREV<BR/><BR/> lda Cache_Next-1,y ; PREV.next = THIS.next<BR/> sta Cache_Next-1,x<BR/> <BR/>; Now link the cache block to the end<BR/><BR/> lda #0<BR/><B>.end</B> sta Cache_Next-1,y ; THIS.next = NULL<BR/><BR/> lax LastCache ; THIS.prev = LAST<BR/><BR/> sta Cache_Prev-1,y<BR/> tya<BR/> sta Cache_Next-1,x ; LAST.next = this<BR/><BR/> sta LastCache ; LAST = this<BR/><BR/><B>.x</B> rts<BR/><BR/>--<BR/>TNTAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-17487316.post-42325112905008279502007-06-24T21:29:00.000+00:002007-06-24T21:29:00.000+00:00no... pretty sure tables are okay - but theres som...no... pretty sure tables are okay - but theres something wrong. If I view the links without this function they are pretty much as expected - add this, and the links go to hell.<BR/><BR/>It might be something else wrong, but I cant see it.. :(Mikehttps://www.blogger.com/profile/15958965170878448339noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-6591544744547934222007-06-24T21:09:00.000+00:002007-06-24T21:09:00.000+00:00Nothing wrong based on a quick glance, but to make...Nothing wrong based on a quick glance, but to make it bug faster you can do TAX after branch, and remove LDA from !We_are_First.<BR/><BR/>Do you init the list correctly? Are you sure tables don't overlap?<BR/><BR/>--<BR/>TNTAnonymousnoreply@blogger.com