1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-21 17:31:31 +00:00

Clear MSB for DLB/DAB

This commit is contained in:
David Schmenk 2018-04-05 11:20:43 -07:00
parent 5285f99a03
commit 558290100c
7 changed files with 107 additions and 16 deletions

View File

@ -312,21 +312,16 @@ def compiler(defptr)#0
codeptr = codeptr + 2
fin
VX-- // DEX
if VY == j
^codeptr = $98; codeptr++ // TYA -> LDA #imm
else
*codeptr = $A9+(j<<8) // LDA #imm
codeptr = codeptr + 2
fin
codeptr->0 = $18 // CLC
codeptr=>1 = $E065 // ADC IFPL
codeptr=>3 = $D095+(VX<<8) // STA ESTKL,X
codeptr=>0 = $A9+(j<<8) // LDA #imm
codeptr->2 = $18 // CLC
codeptr=>3 = $E065 // ADC IFPL
codeptr=>5 = $D095+(VX<<8) // STA ESTKL,X
if VY == 0
codeptr->5 = $98 // TYA -> LDA #00
codeptr = codeptr + 6
codeptr->7 = $98 // TYA -> LDA #00
codeptr = codeptr + 8
else
codeptr=>5 = $00A9 // LDA #$00
codeptr = codeptr + 7
codeptr=>7 = $00A9 // LDA #$00
codeptr = codeptr + 9
fin
codeptr=>0 = $E165 // ADC IFPH
codeptr=>2 = $C095+(VX<<8) // STA ESTKH,X
@ -857,7 +852,14 @@ def compiler(defptr)#0
fin
*codeptr = $E091 // STA (IFP),Y
codeptr = codeptr + 2
break
if VY <> 0
*codeptr = $00A0 // LDY #$00
codeptr = codeptr + 2
VY = 0
fin
*codeptr = $C094+(VX<<8) // STY ESTKH,X
codeptr = codeptr + 2
break
is $6E // DLW
i++
j = ^(bytecode+i)
@ -973,6 +975,13 @@ def compiler(defptr)#0
if opcode == $7C
//puts("DAB $"); puth(*(bytecode+i))
codeptr = codeptr + 3
if VY <> 0
*codeptr = $00A0 // LDY #$00
codeptr = codeptr + 2
VY = 0
fin
*codeptr = $C094+(VX<<8) // STY ESTKH,X
codeptr = codeptr + 2
else
codeptr=>3 = $C0B4+(VX<<8) // LDY ESTKH,X
codeptr->5 = $8C // STY abs+1

View File

@ -260,8 +260,8 @@ end
//
export def drawmap(xorg, yorg, viewfield, viewdir, lightdist, viewdist)
byte o, l, dist, tile, adjtile, occluded, darkness
word ymap, xmap, imap
byte l, dist, tile, adjtile, occluded, darkness
word ymap, xmap, imap, o
byte yscr, xscr
if viewdist > beamdepth

View File

@ -658,6 +658,8 @@ DLB INY ;+INC_IP
TAY
LDA ESTKL,X
STA (IFP),Y
LDA #$00
STA ESTKH,X
LDY IPY
JMP NEXTOP
DLW INY ;+INC_IP
@ -718,6 +720,8 @@ DAB INY ;+INC_IP
STA ESTKH-1,X
LDA ESTKL,X
STA (ESTKH-2,X)
LDA #$00
STA ESTKH,X
JMP NEXTOP
DAW INY ;+INC_IP
LDA (IP),Y

View File

@ -1448,6 +1448,8 @@ DLB INY ;+INC_IP
TAY
LDA ESTKL,X
STA (IFP),Y
LDA #$00
STA ESTKH,X
LDY IPY
JMP NEXTOP
DLW INY ;+INC_IP
@ -1509,6 +1511,8 @@ DAB INY ;+INC_IP
STA ESTKH-1,X
LDA ESTKL,X
STA (ESTKH-2,X)
LDA #$00
STA ESTKH,X
JMP NEXTOP
DAW INY ;+INC_IP
LDA (IP),Y
@ -2262,6 +2266,37 @@ CDAW INY ;+INC_IP
LDY IPY
JMP NEXTOP
CDAWEND
;
LDA #<DAB
LDX #>DAB
LDY #(CDABEND-CDAB)
JSR OPCPY
CDAB INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
LDA (IP),Y
STA ESTKH-1,X
LDA ESTKL,X
STA (ESTKH-2,X)
STZ ESTKH,X
JMP NEXTOP
CDABEND
;
LDA #<DLB
LDX #>DLB
LDY #(CDLBEND-CDLB)
JSR OPCPY
CDLB INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
LDA ESTKL,X
STA (IFP),Y
STZ ESTKH,X
LDY IPY
JMP NEXTOP
CDLBEND
;
LDA #<ISFLS
LDX #>ISFLS

View File

@ -984,6 +984,8 @@ DLB INY ;+INC_IP
TAY
LDA ESTKL,X
STA (IFP),Y
LDA #$00
STA ESTKH,X
LDY IPY
JMP NEXTOP
DLW INY ;+INC_IP
@ -1044,6 +1046,8 @@ DAB INY ;+INC_IP
STA ESTKH-1,X
LDA ESTKL,X
STA (ESTKH-2,X)
LDA #$00
STA ESTKH,X
JMP NEXTOP
DAW INY ;+INC_IP
LDA (IP),Y

View File

@ -1262,6 +1262,8 @@ DLB INY ;+INC_IP
LDA TOS,S
STA (IFP),Y
+ACCMEM16 ; 16 BIT A/M
AND #$00FF
STA TOS,S
TXY
JMP NEXTOP
DLW INY ;+INC_IP
@ -1304,6 +1306,8 @@ DAB INY ;+INC_IP
LDA TOS,S
STA (TMP)
+ACCMEM16 ; 16 BIT A/M
AND #$00FF
STA TOS,S
INY ;+INC_IP
JMP NEXTOP
DAW INY ;+INC_IP

View File

@ -1511,6 +1511,8 @@ DLB INY ;+INC_IP
TAY
LDA ESTKL,X
STA (IFP),Y
LDA #$00
STA ESTKH,X
LDY IPY
JMP NEXTOP
DLW INY ;+INC_IP
@ -1572,6 +1574,8 @@ DAB INY ;+INC_IP
STA ESTKH-1,X
LDA ESTKL,X
STA (ESTKH-2,X)
LDA #$00
STA ESTKH,X
JMP NEXTOP
DAW INY ;+INC_IP
LDA (IP),Y
@ -2304,6 +2308,37 @@ CDAW INY ;+INC_IP
LDY IPY
JMP NEXTOP
CDAWEND
;
LDA #<DAB
LDX #>DAB
LDY #(CDABEND-CDAB)
JSR OPCPY
CDAB INY ;+INC_IP
LDA (IP),Y
STA ESTKH-2,X
INY ;+INC_IP
LDA (IP),Y
STA ESTKH-1,X
LDA ESTKL,X
STA (ESTKH-2,X)
STZ ESTKH,X
JMP NEXTOP
CDABEND
;
LDA #<DLB
LDX #>DLB
LDY #(CDLBEND-CDLB)
JSR OPCPY
CDLB INY ;+INC_IP
LDA (IP),Y
STY IPY
TAY
LDA ESTKL,X
STA (IFP),Y
STZ ESTKH,X
LDY IPY
JMP NEXTOP
CDLBEND
;
LDA #<ISFLS
LDX #>ISFLS