0 Members and 1 Guest are viewing this topic.
also, I took the liberty of writing a quick EXAMPLE 3 level gray rendering routine in assembly. I just took a few minutes to basically show how it'll work in theory -- in implementation I have no idea how this would look, it has some mistakes I'm sure and no interrupt triggering. But here's what it shoudl look generally like:Code: [Select]Level3copyInt LD HL, Buf1 + 767 LD DE, Buf2 + 767 PUSH HL PUSH DE LD C, $10 LD A, $04 ;this uses Y auto-decrement mode ;) OUT (C), A LD B,64 LD A,12 PUSH AF@ ;set to last row.db $ED,$70 JP M,{-1@} OUT (C), $BF@ ;set to last column.db $ED,$70 ;IN F, (C) JP M,{-1@} OUT (C), $2E LD A,12 PUSH AF@ LD A, (HL) AND %10101010 DEC HL PUSH HL PUSH AF LD A, (DE) AND %01010101 DEC DE POP HL OR H POP HL@.db $ED,$70 ;IN F, (C) JP M,{-1@} OUT ($11),A POP AF PUSH AF EX DE, HL DEC A CP $00 JR Z,{-2@} DJNZ {-3@}@ RET
Level3copyInt LD HL, Buf1 + 767 LD DE, Buf2 + 767 PUSH HL PUSH DE LD C, $10 LD A, $04 ;this uses Y auto-decrement mode ;) OUT (C), A LD B,64 LD A,12 PUSH AF@ ;set to last row.db $ED,$70 JP M,{-1@} OUT (C), $BF@ ;set to last column.db $ED,$70 ;IN F, (C) JP M,{-1@} OUT (C), $2E LD A,12 PUSH AF@ LD A, (HL) AND %10101010 DEC HL PUSH HL PUSH AF LD A, (DE) AND %01010101 DEC DE POP HL OR H POP HL@.db $ED,$70 ;IN F, (C) JP M,{-1@} OUT ($11),A POP AF PUSH AF EX DE, HL DEC A CP $00 JR Z,{-2@} DJNZ {-3@}@ RET
quit: b_call(_ClrLCDFull) ld hl,AppVar b_call(_Mov9toOp1) b_call(_ChkFindSym) jr nc,overwritecreateappvar: ld hl,AppVar b_call(_Mov9toOp1) ld hl,14 b_call(_CreateAppVar)overwrite: ld a,b or a jp nz,unarc2 ld hl,ShieldPoints ld bc,8 ldir ld hl,photons ld bc,6 ldir ld hl,AppVar b_call(_Mov9toOp1) call arcf ret
Ok. Can someone add to that a way to trigger interrupts, then how to disable them. I'd rather not mess with interrupts myself. Once that is done, I'll give the code a whirl and fix it up (if it needs it).Edit: First successful compile. This seems to freeze:Code: [Select]quit: b_call(_ClrLCDFull) ld hl,AppVar b_call(_Mov9toOp1) b_call(_ChkFindSym) jr nc,overwritecreateappvar: ld hl,AppVar b_call(_Mov9toOp1) ld hl,14 b_call(_CreateAppVar)overwrite: ld a,b or a jp nz,unarc2 ld hl,ShieldPoints ld bc,8 ldir ld hl,photons ld bc,6 ldir ld hl,AppVar b_call(_Mov9toOp1) call arcf ret
Maybe it's code at some other section that's freezing up?
ld a,i push af di ld a,$80 out ($10),a ld (OP2),sp ld hl,flags+asm_Flag2 rr (hl) sbc a,a xor %01010101 ld (hl),a ld c,a ld l,appbackupscreen&$ff-1 ld sp,plotSScreen-appbackupscreen__DispGSNext: ld a,l ;4 ld b,64 ;7 add a,$21-(appbackupscreen&$ff);7 out ($10),a ;11 Into loop: 59 T-states inc l ;4 ld h,appbackupscreen>>8 ;7 ld de,appbackupscreen-plotSScreen+12;11__DispGSLoop: ld a,(hl) ;7 Loop: 61 T-states rrc c ;8 and c ;4 add hl,sp ;11 or (hl) ;7 out ($11),a ;11 add hl,de ;11 djnz __DispGSLoop ;13/8 Next Loop: 60 T-states ld a,l ;4 cp 12+(appbackupscreen&$ff);7 jr nz,__DispGSNext ;12__DispGSDone: ld sp,(OP2) pop af ret po ei ret
Remember not to double-post unless it's been six hours Is that code the three-level grayscale routine? Remember that the buffer is plotSScreen and the back-buffer is appBackUpScreen, so just replace those with whatever you're using.EDIT: And make sure you know how the code works. It's a bad idea to go about using ASM code without knowing exactly what it does, because it makes messing up that much easier.
COUNTDOWN TO BETAI hope to have a beta release out soon. It won't have exceptional graphics, but it will be functional...