Skip to content

Commit

Permalink
Updating comments and splitting out subroutines into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
unorig committed May 6, 2024
1 parent 76e547c commit 7dbfa00
Show file tree
Hide file tree
Showing 11 changed files with 886 additions and 1,126 deletions.
8 changes: 4 additions & 4 deletions 2 Paris/2.dis65
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
"Type":"ExternalAddr",
"LabelAnno":"None"},

"V_MapLoadAddressLow":{
"V_MapYposition":{
"DataDescriptor":{
"Length":1,
"Format":"NumericLE",
Expand All @@ -457,13 +457,13 @@
"HasWidth":false,
"Direction":"ReadWrite",
"MultiMask":null,
"Label":"V_MapLoadAddressLow",
"Label":"V_MapYposition",
"Value":829,
"Source":"Project",
"Type":"ExternalAddr",
"LabelAnno":"None"},

"V_MapRow":{
"V_MapXposition":{
"DataDescriptor":{
"Length":1,
"Format":"NumericLE",
Expand All @@ -474,7 +474,7 @@
"HasWidth":false,
"Direction":"ReadWrite",
"MultiMask":null,
"Label":"V_MapRow",
"Label":"V_MapXposition",
"Value":828,
"Source":"Project",
"Type":"ExternalAddr",
Expand Down
58 changes: 29 additions & 29 deletions 2 Paris/2_64tass.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ V_CarPosHorizontalLow = $0338
V_CarPosHorizontalHigh = $0339
V_CarPositionVertLow = $033a
V_CarPositionVertHigh = $033b
V_MapRow = $033c
V_MapLoadAddressLow = $033d
V_HorzRasterScrollLoop = $033e
V_MapXposition = $033c
V_MapYposition = $033d
V_HorzRasterScrollLoop = $033e
WhatIsThis = $033f
V_CarSpeed = $0340
V_MapDrawSpeed = $0342
Expand Down Expand Up @@ -6217,18 +6217,18 @@ _L4606 ldy V_CarFacingDirection ;00 N / 01 NE / 02 E / 03 SE / 04 S / 05 SW
bmi _L4627
clc
lda #$7e
adc V_MapRow
adc V_MapXposition
sta V_SpritePointerIndex
lda V_MapLoadAddressLow
lda V_MapYposition
adc #$00
sta V_SprCarDistHorizDiffHigh
jmp _L466E

_L4627 sec
lda V_MapRow
lda V_MapXposition
sbc #$7e
sta V_SpritePointerIndex
lda V_MapLoadAddressLow
lda V_MapYposition
sbc #$00
sta V_SprCarDistHorizDiffHigh
jmp _L466E
Expand All @@ -6238,25 +6238,25 @@ _L4639 lda $0334
bmi _L4652
clc
lda #$01
adc V_MapRow
adc V_MapXposition
sta V_SpritePointerIndex
lda V_MapLoadAddressLow
lda V_MapYposition
adc #$00
sta V_SprCarDistHorizDiffHigh
jmp _L466E

_L4652 sec
lda V_MapRow
lda V_MapXposition
sbc #$01
sta V_SpritePointerIndex
lda V_MapLoadAddressLow
lda V_MapYposition
sbc #$00
sta V_SprCarDistHorizDiffHigh
jmp _L466E

_L4664 lda V_MapRow
_L4664 lda V_MapXposition
sta V_SpritePointerIndex
lda V_MapLoadAddressLow
lda V_MapYposition
sta V_SprCarDistHorizDiffHigh
_L466E lda V_SpritePointerIndex
sta $02fb
Expand Down Expand Up @@ -7383,9 +7383,9 @@ L4D92 jsr L4C00
.byte $ff

MapLoadTempLow
lda V_MapRow
lda V_MapXposition
sta V_SpritePointerIndex
lda V_MapLoadAddressLow
lda V_MapYposition
sta V_SprCarDistHorizDiffHigh
lda $0335
beq _L4E2E
Expand Down Expand Up @@ -9625,10 +9625,10 @@ Sub_LoadNewMapRow
lda $0350,x
bmi _L5CED
clc
adc V_MapRow
sta V_MapRow
adc V_MapXposition
sta V_MapXposition
bcc _L5CDD
inc V_MapLoadAddressLow
inc V_MapYposition
_L5CDD ldy $0334
dey
cpy #$fe
Expand All @@ -9638,11 +9638,11 @@ _L5CE7 sty $0334
jmp _L5D08

_L5CED sec
lda V_MapRow
lda V_MapXposition
sbc #$01
sta V_MapRow
sta V_MapXposition
bcs _L5CFB
dec V_MapLoadAddressLow
dec V_MapYposition
_L5CFB ldy $0334
iny
cpy #$02
Expand All @@ -9658,10 +9658,10 @@ _L5D08 lda V_ScrollCounter ;North/South = #02. East/West = #01.
lda $0360,x ;North = #fe
bmi _L5D37
clc
adc V_MapRow
sta V_MapRow
adc V_MapXposition
sta V_MapXposition
bcc _L5D27
inc V_MapLoadAddressLow
inc V_MapYposition
_L5D27 ldy $0335
dey
cpy #$fe
Expand All @@ -9671,11 +9671,11 @@ _L5D31 sty $0335
jmp _L5D52

_L5D37 sec
lda V_MapRow ;Load map address
lda V_MapXposition ;Load map address
sbc #$7e ;#7e = 126 which is the width of the map
sta V_MapRow ;Update map row
sta V_MapXposition ;Update map row
bcs _L5D45
dec V_MapLoadAddressLow
dec V_MapYposition
_L5D45 ldy $0335
iny
cpy #$02
Expand All @@ -9687,9 +9687,9 @@ _L5D52 ldx #$0d
sta V_ScreenAddress+1 ;Self-modifying code
lda #$05
sta V_ScreenAddress+2 ;Self-modifying code
lda V_MapRow
lda V_MapXposition
sta Loop_MapScreenUpdate+1 ;V_MapLoadAddressHigh
lda V_MapLoadAddressLow
lda V_MapYposition
sta Loop_MapScreenUpdate+2 ;Self-modifying code
L5D6A ldy #$28 ;#28 = 40. This would be a row of the map.
Loop_MapScreenUpdate
Expand Down
132 changes: 132 additions & 0 deletions 2 Paris/4290.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
l_4290
LDX #$0F ; (4290) Set X to #$0F (15 / 00001111)

l_4292
LDA $6900,X ; (4292) Load A with $6900,X
SEC ; (4295) Set Carry Flag
SBC var_BondCarXPosLow ; (4296) Subtract with Carry $0338
STA $AD ; (4299) Store A to $AD
LDA $6940,X ; (429B) Load A with $6940,X
SBC var_BondCarXPosHigh ; (429E) Subtract with Carry $0339
STA $AF ; (42A1) Store A to $AF
BEQ l_42AF ; (42A3) Branch to $42AF if Equal. This determines the other sprite below distance of #100.
CMP #$01 ; (42A5) Subtract #$01 from A (1 / 00000001)
BNE l_431E ; (42A7) Branch to $431E if Not Equal. This determines if the distance is above #1ff.
LDA $AD ; (42A9) Load A with $AD
CMP #$40 ; (42AB) Subtract #$40 from A (64 / 01000000)
BCS l_431E ; (42AD) Branch if Carry Set $431E

l_42AF
LDA $6980,X ; (42AF) Load A with $6980,X
SEC ; (42B2) Set Carry Flag
SBC $033A ; (42B3) Subtract with Carry $033A
STA $FD ; (42B6) Store A to $FD
LDA $69C0,X ; (42B8) Load A with $69C0,X
SBC $033B ; (42BB) Subtract with Carry $033B
BNE l_431E ; (42BE) Branch to $431E if Not Equal
LDA $FD ; (42C0) Load A with $FD
CMP #$70 ; (42C2) Subtract #$70 from A (112 / 01110000)
BCS l_431E ; (42C4) Branch if Carry Set $431E
LDA $6910,X ; (42C6) Load A with $6910,X
TAY ; (42C9) Transfer A to Y
BMI l_42E7 ; (42CA) Branch to $42E7 if minus
AND #$40 ; (42CC) Logical AND with Accumulator and #$40 (64 / 01000000)
BNE l_4317 ; (42CE) Branch to $4317 if Not Equal
TYA ; (42D0) Transfer Y to A
AND #$07 ; (42D1) Logical AND with Accumulator and #$07 (7 / 00000111)
TAY ; (42D3) Transfer A to Y
LDA $03C8,Y ; (42D4) Load A with $03C8,Y
AND SpriteEnableRegister ; (42D7) Logical AND with Accumulator $D015
BEQ l_42E7 ; (42DA) Branch to $42E7 if Equal
LDA $6910,X ; (42DC) Load A with $6910,X
ORA #$40 ; (42DF) Logical OR with Accumulator and #$40 (64 / 01000000)
STA $6910,X ; (42E1) Store A to $6910,X
JMP l_4317 ; (42E4) Jump to $4317

l_42E7
LDA $6910,X ; (42E7) Load A with $6910,X
ORA #$80 ; (42EA) Logical OR with Accumulator and #$80 (128 / 10000000)
STA $6910,X ; (42EC) Store A to $6910,X
AND #$07 ; (42EF) Logical AND with Accumulator and #$07 (7 / 00000111)
STA $02 ; (42F1) Store A to $02
INC $02 ; (42F3) Increment Memory $02
LDA SpritePointerArray,X ; (42F5) Load A with $6920,X
STA $AE ; (42F8) Store A to $AE
TXA ; (42FA) Transfer X to A
PHA ; (42FB) Push Accumulator to Stack
LDA $FD ; (42FC) Load A with $FD
CLC ; (42FE) Clear Carry Flag
ADC #$90 ; (42FF) Add with Carry with #$90 (144 / 10010000)
TAY ; (4301) Transfer A to Y
CLC ; (4302) Clear Carry Flag
LDA $AD ; (4303) Load A with $AD
ADC #$07 ; (4305) Add with Carry with #$07 (7 / 00000111)
TAX ; (4307) Transfer A to X
LDA $AF ; (4308) Load A with $AF
ADC #$00 ; (430A) Add with Carry with #$00 (0 / 00000000)
CLC ; (430C) Clear Carry Flag
BEQ l_4310 ; (430D) Branch to $4310 if Equal
SEC ; (430F) Set Carry Flag

l_4310
LDA $02 ; (4310) Load A with $02
JSR l_4200 ; (4312) Jump to Subroutine at $4200
PLA ; (4315) Pull Accumulator from Stack
TAX ; (4316) Transfer A to X

l_4317
DEX ; (4317) Decrement X
BMI l_431D ; (4318) Branch to $431D if minus
JMP l_4292 ; (431A) Jump to $4292

l_431D
RTS ; (431D) Return from Subroutine

l_431E
LDA $6910,X ; (431E) Load A with $6910,X
TAY ; (4321) Transfer A to Y
BMI l_4357 ; (4322) Branch to $4357 if minus

l_4324
AND #$10 ; (4324) Logical AND with Accumulator and #$10 (16 / 00010000)
BNE l_4330 ; (4326) Branch to $4330 if Not Equal
JMP l_4375 ; (4328) Jump to $4375

* = $432B
.byte $EA,$EA,$EA,$EA,$EA

* = $4330

l_4330
LDA $6800,X ; (4330) Load A with $6800,X
STA $6900,X ; (4333) Store A to $6900,X
LDA $6840,X ; (4336) Load A with $6840,X
STA $6940,X ; (4339) Store A to $6940,X
LDA $6880,X ; (433C) Load A with $6880,X
STA $6980,X ; (433F) Store A to $6980,X
LDA $68C0,X ; (4342) Load A with $68C0,X
STA $69C0,X ; (4345) Store A to $69C0,X
LDA $6820,X ; (4348) Load A with $6820,X
STA SpritePointerArray,X ; (434B) Store A to $6920,X
LDA $6830,X ; (434E) Load A with $6830,X
STA MaydayDirection,X ; (4351) Store A to $6930,X
JMP l_4375 ; (4354) Jump to $4375

l_4357
LDA $6910,X ; (4357) Load A with $6910,X
AND #$07 ; (435A) Logical AND with Accumulator and #$07 (7 / 00000111)
TAY ; (435C) Transfer A to Y
LDA $03C0,Y ; (435D) Load A with $03C0,Y
AND SpriteEnableRegister ; (4360) Logical AND with Accumulator $D015
STA SpriteEnableRegister ; (4363) Store A to $D015
LDA $03C0,Y ; (4366) Load A with $03C0,Y
AND SpriteMulticolor ; (4369) Logical AND with Accumulator $D01C
STA SpriteMulticolor ; (436C) Store A to $D01C
LDA $6910,Y ; (436F) Load A with $6910,Y
JMP l_4324 ; (4372) Jump to $4324

l_4375
LDA $6910,X ; (4375) Load A with $6910,X
AND #$07 ; (4378) Logical AND with Accumulator and #$07 (7 / 00000111)
STA $6910,X ; (437A) Store A to $6910,X
JMP l_4317 ; (437D) Jump to $4317
Loading

0 comments on commit 7dbfa00

Please sign in to comment.