Mike Harris Posted December 22, 2018 Author Share Posted December 22, 2018 OK, hate to say I stayed up last night but I did.I had to write my new map routine and I can say I am done with it.4 bytes per row at 24 rows Here is a sample code that reads the bits BIT_DRAW:PUSH DEPUSH BC LD DE, BLOCK LD C, A BIT 0,C JR Z, RD_BIT_1 CALL DO_ITRD_BIT_1: INC HL BIT 1,C JR Z, RD_BIT_2 CALL DO_ITRD_BIT_2: INC HL BIT 2,C JR Z, RD_BIT_3 CALL DO_ITRD_BIT_3: INC HL BIT 3,C JR Z, RD_BIT_4 CALL DO_ITRD_BIT_4: INC HL BIT 4,C JR Z, RD_BIT_5 CALL DO_ITRD_BIT_5: INC HL BIT 5,C JR Z, RD_BIT_6 CALL DO_ITRD_BIT_6: INC HL BIT 6,C JR Z, RD_BIT_7 CALL DO_ITRD_BIT_7: INC HL BIT 7,C JR Z, END_THIS CALL DO_ITEND_THIS: INC HLPOP BCPOP DERET It took me a couple of hours and I had to write it into long form then I shortened it into a loop.You may say why but I went from of 12k down to 4 just by saving map data.My character is already moving and I have all my sprite data.So, I am estimating this will be either an 8 or 12k before more optimizations. Quote Link to comment Share on other sites More sharing options...
Mike Harris Posted December 23, 2018 Author Share Posted December 23, 2018 (edited) Refined my routine to 2 bytes per map data with mirror. Great routine to reverse any 8 bit number. Got the idea from the original OS7 Reverse Sprite Routine listed in my ADAM Technical Reference Manual I bought back in 84. MIRROR: LD b,8 ; All 8 bits LD l,a ; Byte to be reverseREVERSE_ME: RL l RRA DJNZ REVERSE_MERET ; return from call Edited December 23, 2018 by Mike Harris Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.