jmechner April 17, 2012
Attempted line ending fix

0 contributors

## Users on GitHub who have contributed to this file

100755 1193 lines (996 sloc) 16.05 kb

- Edit this file
- Raw
- Blame
- History

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
    1147
    1148
    1149
    1150
    1151
    1152
    1153
    1154
    1155
    1156
    1157
    1158
    1159
    1160
    1161
    1162
    1163
    1164
    1165
    1166
    1167
    1168
    1169
    1170
    1171
    1172
    1173
    1174
    1175
    1176
    1177
    1178
    1179
    1180
    1181
    1182
    1183
    1184
    1185
    1186
    1187
    1188
    1189
    1190
    1191
    1192
    * gamebgThreeFive = 1EditorDisk = 0org = $4c00 tr on lst off lstdo off*-------------------------------**  PRINCE OF PERSIA*  Copyright 1989 Jordan Mechner**------------------------------- org org
     jmp UPDATEMETERS jmp DRAWKIDMETER jmp DRAWSWORD jmp DRAWKID jmp DRAWSHAD
     jmp SETUPFLAME jmp CONTINUEMSG jmp ADDCHAROBJ jmp SETOBJINDX jmp PRINTLEVEL
     jmp DRAWOPPMETER jmp FLIPDISKMSG jmp TIMELEFTMSG jmp DRAWGUARD jmp DRAWGUARD
     jmp SETUPFLASK jmp SETUPCOMIX jmp PSETUPFLAME jmp DRAWPOST jmp DRAWGLASS
     jmp INITLAY jmp TWINKLE jmp FLOW jmp PMASK jmp YELLOW
     jmp SETRECHECK0 jmp RECHECKYEL ds 3 ds 3 ds 3
    *------------------------------- lst put eq lst put gameeq lst off
    *-------------------------------** 2nd level copy protection* signature check routine**------------------------------- do ThreeFiveYELLOW lda #$80 sta yellowflag rts
     else put ryellow1 fin
    *------------------------------- lst put movedata lst off
    *------------------------------- dum locals
    xsave ds 1addr ds 2temp ds 1
     dend
    tempsave ds $10
    *-------------------------------* Strength meters
    KidStrX db 00,01,02,03,04,05,06,08,09,10,11,12KidStrOFF db 00,01,02,03,04,05,06,00,01,02,03,04
    OppStrX db 39,38,37,36,35,34,32,31,30,29,28,27OppStrOFF db 05,04,03,02,01,00,06,05,04,03,02,01
    bullet = $88 ;in bgtable2blank = $8cbline hex 89,8a,8b
    *-------------------------------* Post in Princess's room
    postx = 31posty = 152postimg = $c ;chtable6
    *-------------------------------* Stars outside Princess's window
    starx = 2stary hex 62,65,6d,72stari hex 2a,2b,2b,2a ;chtable6
    *-------------------------------* Hourglass
    glassx = 19glassy = 151glassimg hex 15,0d,0e,0f,10,11,12,13,14 ;chtable6sandht db 0,1,2,3,4,5,6,7
    flowx = glassx+1flowy = glassy-2flowimg hex 16,17,18 ;chtable6
    *-------------------------------* Masks for Princess's face & hair
    pmaskdx hex 00,00pmaskdy db -4,-33pmaski hex 2c,22
    *-------------------------------* Comix
    starimage = $41startable = 0 ;chtable1
    *-------------------------------* Torch animation frames*               0  1  2  3  4  5  6  7  8  9 10 11*              12 13 14 15 16 17
    torchflame hex 52,53,54,55,56,61,62,63,64,52,54,56 hex 63,61,55,53,64,62
    ptorchflame db 1,2,3,4,5,6,7,8,9,3,5,7,1,4,9,2,8,6
    *-------------------------------* Bubbling flask frames*               0  1  2  3  4  5  6  7  8  9 10 11
    bubble hex b2,af,b0,b1,b0,af,b1,b0,af
    *-------------------------------* Message data: YCO, XCO, OFFSET, IMAGE
    my = 90lowmy = 153hiconty = 73lowconty = 168
    contbox db hiconty,13,0,$7c ;Press button to continuemsgbox db my,15,0,$7b ;Empty message boxlevelmsg db my-5,16,3,$7a ;"Level"flipbox db my-1,13,0,$7e ;Turn disk overtimeleft db my,11,0,$7d ;Minutes leftseconds db my-5,14,0,$7f ;"Seconds"
    *-------------------------------* Numbers (0-12)
    digit1 hex 00,00,00,00,00,00,00,00,00,00 hex 71,71,71
    digit2 hex 70,71,72,73,74,75,76,77,78,79 hex 70,71,72
    *-------------------------------* Print "XX Minutes Left"*-------------------------------]rts rts
    TIMELEFTMSG lda #timeleft ldx #>timeleft jsr setupimage
     lda MinLeft cmp #2 bcs :ok lda KidAction cmp #3 beq :ok cmp #4 beq :ok ;falling lda KidBlockY cmp #1 bne :ok lda #lowmy sta YCO ;keep msg box out of kid's way:ok jsr superim1
     lda YCO sec sbc #5 sta YCO
     lda XCO clc adc #1 sta XCO lda #0 sta OPACITY
     lda #ora sta OPACITY
     jsr getminleft
     lda MinLeft ;BCD byte (e.g., $55 = 55 minutes) cmp #2 bcs :1 lda SecLeft:1 sta temp lsr lsr lsr lsr beq :skip1st tax lda digit2,x ;1st digit sta IMAGE
     jsr addmsg
    :skip1st lda XCO clc adc #1 sta XCO
     lda temp and #$f tax lda digit2,x ;2nd digit sta IMAGE
     jsr addmsg
    * Minutes or seconds?
     lda MinLeft cmp #2 bcs ]rts
     lda YCO pha lda #seconds ldx #>seconds jsr setupimage pla sta YCO lda #sta sta OPACITY jmp addmsg ;replace "minutes" with "seconds"
    *-------------------------------* Print "Level XX"*-------------------------------]rts rts
    PRINTLEVEL lda #msgbox ldx #>msgbox jsr superimage
     lda #levelmsg ldx #>levelmsg jsr setupimage
     jsr getlevelno cpx #10 bcc :1 lda #0 sta OFFSET:1 lda #ora sta OPACITY jsr addmsg
     lda XCO clc adc #6 sta XCO
     jsr getlevelno ;X = level # (0-12) lda digit1,x ;1st digit beq :skip1st sta IMAGE
     lda #ora sta OPACITY jsr addmsg
     lda XCO clc adc #1 sta XCO
     jsr getlevelno:skip1st lda digit2,x ;2nd digit sta IMAGE
     lda #ora sta OPACITY jmp addmsg
    *-------------------------------getlevelno ldx level cpx #13 bcc :ok ldx #12:ok]rts rts
    *-------------------------------* Superimpose "Press button to continue" message*-------------------------------CONTINUEMSG lda #contbox ldx #>contbox jsr setupimage
     lda KidBlockX and #1 bne :1 lda #lowconty sta YCO:1 jmp superim1
    *-------------------------------* Superimpose "Turn disk over" message*-------------------------------FLIPDISKMSG lda #flipbox ldx #>flipbox jmp superimage
    *-------------------------------* Superimpose image (using layrsave)*-------------------------------superimage jsr setupimagesuperim1 lda #sta.$40 sta OPACITY jmp addmsg
    *-------------------------------* Set up image** In: A-X = image data addr* Out: XCO, YCO, IMAGE*-------------------------------setupimage sta addr stx addr+1
     ldy #0 lda (addr),y sta YCO iny lda (addr),y sta XCO iny lda (addr),y sta OFFSET iny lda (addr),y sta IMAGE]rts:rts rts
    *-------------------------------* Draw Kid*-------------------------------DRAWKID lda backtolife beq :2 lda PAGE beq ]rts ;flash when coming back to life
    :2 lda mergetimer bmi :1 and #1 beq :1 jmp DrawEored ;flash between kid & shadowman
    :1 jmp DrawNormal
    *-------------------------------* Draw Sword*-------------------------------DRAWSWORD jmp DrawNormal
    *-------------------------------* Draw Shadowman*-------------------------------DRAWSHAD jmp DrawEored
    *-------------------------------* Draw Guard*-------------------------------DRAWGUARD do EditorDisk lda #EditorDisk cmp #2 beq DrawNormal fin
     lda GuardColor ;set by "ADDGUARD" in AUTO beq DrawNormal bne DrawShifted
    *-------------------------------DrawNormal lda #mask sta OPACITY
     lda #UseLayrsave.$80 jmp addmid
    ]rts rts
    *-------------------------------DrawShifted lda #1 jsr chgoffset
     lda #mask sta OPACITY
     lda #UseLayrsave.$80 jmp addmid
    *-------------------------------DrawEored lda #eor sta OPACITY
     lda #UseLayrsave.$80 jmp addmid
    *-------------------------------chgoffset clc adc OFFSET cmp #7 bcc :1
     inc XCO sec sbc #7
    :1 sta OFFSET rts
    *-------------------------------** Update strength meters**-------------------------------UPDATEMETERS lda redkidmeter beq :1
     jsr DrawKidMeter
    :1 lda redoppmeter beq ]rts
     jmp DrawOppMeter]rts rts
    *-------------------------------** Draw kid's strength meter at lower left**-------------------------------DRAWKIDMETER lda inbuilder bne ]rts
     lda #191 sta YCO lda #sta sta OPACITY
     ldx #0 stx xsave ;# of bullets drawn so far
    :loop lda KidStrength sec sbc xsave ;# of bullets left to draw beq :darkpart cmp #4 bcs :draw3 cmp #3 bcs :draw2 cmp #2 bcc :drawlast;Draw 1 bullet:draw1 ldy #1 bne :drline ;Draw 2 bullets:draw2 ldy #2 bne :drline;Draw 3 bullets:draw3 ldy #3 bne :drline
    :drawlast lda KidStrength cmp #2 bcs :steady lda PAGE beq :skip ;flashes when down to 1:steady lda #bullet ldy #1 jsr :draw:skip jmp :darkpart
    * Draw line of 1-3 bullets
    :drline lda bline-1,y ;image # jsr :draw jmp :loop
    :draw sta IMAGE ldx xsave tya clc adc xsave sta xsave
    * In: IMAGE; x = unit # (0 = leftmost)
    :drawimg lda KidStrX,x sta XCO lda KidStrOFF,x sta OFFSET jmp addmsg
    * Draw blanks to limit of MaxKidStr
    :darkpart lda #and sta OPACITY lda #blank sta IMAGE:dloop ldx xsave cpx MaxKidStr bcs ]rts jsr :drawimg inc xsave bne :dloop]rts rts
    *-------------------------------** Draw opp's strength meter at lower right**-------------------------------DRAWOPPMETER lda inbuilder bne ]rts
     lda OppStrength beq ]rts
     lda ShadID cmp #24 ;mouse beq ]rts cmp #4 ;skel beq ]rts cmp #1 ;shadow bne :1 lda level cmp #12 bne ]rts ;shad strength shows only on level 12:1 lda #191 sta YCO lda #sta.$80 ;mirror sta OPACITY
     ldx #0 stx xsave ;# of bullets drawn so far
    :loop lda OppStrength sec sbc xsave ;# of bullets left to draw beq :darkpart cmp #4 bcs :draw3 cmp #3 bcs :draw2 cmp #2 bcc :drawlast;Draw 1 bullet:draw1 ldy #1 bne :drline ;Draw 2 bullets:draw2 ldy #2 bne :drline;Draw 3 bullets:draw3 ldy #3 bne :drline
    :drawlast lda OppStrength cmp #2 bcs :steady lda PAGE beq :darkpart ;flashes when down to 1:steady lda #bullet ldy #1 jmp :draw
    * Draw line of 1-3 bullets
    :drline lda bline-1,y ;image # jsr :draw jmp :loop
    :draw sta IMAGE ldx xsave tya clc adc xsave sta xsave
    :drawimg lda OppStrX,x sta XCO lda OppStrOFF,x sta OFFSET jmp addmsg
    :darkpart lda #and.$80 sta OPACITY lda #blank sta IMAGE ldx xsave jmp :drawimg
    *-------------------------------** Set up to draw bubbling flask** In/out: same as SETUPFLAME**-------------------------------EmptyPot = 0RefreshPot = %00100000BoostPot = %01000000MystPot = %01100000
    boffset = 2
    SETUPFLASK lda #boffset sta OFFSET
     txa and #%11100000 cmp #EmptyPot beq :0 cmp #BoostPot beq :tall ;special flask (taller) bcc :cont
     inc OFFSET ;mystery potion (blue)
    :tall lda YCO sec sbc #4 sta YCO
    :cont txa and #%00011111 tax cpx #bubbLast+1 bcc :ok ldx #0:ok lda bubble,x sta IMAGE
     inc XCO inc XCO
     lda YCO sec sbc #14 sta YCO
     lda #sta sta OPACITY
     lda #bgtable2 sta TABLE lda #>bgtable2 sta TABLE+1
    ]rts rts
    :0 ldx #0 beq :ok
    *-------------------------------** Setup to draw flame** In: XCO = blockxco*     YCO = Ay*     X   = spreced** Out: ready to call ADDBACK (or FASTLAY)**-------------------------------SETUPFLAME cpx #torchLast+1 bcs ]rts
     lda torchflame,x sta IMAGE
     inc XCO
     lda YCO sec sbc #43 sta YCO
     lda #sta sta OPACITY
     lda #bgtable1 sta TABLE lda #>bgtable1 sta TABLE+1
    ]rts rts
    *-------------------------------** Setup to draw flame (Princess's room)** In: XCO, YCO; X = frame #* Out: Ready to call ADDMID or LAY**-------------------------------PSETUPFLAME cpx #torchLast+1 bcs ]rts
     lda ptorchflame,x sta IMAGE
     lda #sta sta OPACITY
     jsr initlay
    ]setch6 lda #chtable6 sta TABLE lda #>chtable6 sta TABLE+1
    ]rts rts
    *-------------------------------** Twinkle one of the stars outside Princess's window* (Update it directly on both screens)** In: X = star # (0-3)**-------------------------------TWINKLE lda #starx sta XCO lda stary,x sta YCO lda stari,x sta IMAGE lda #eor sta OPACITY jsr ]setch6 jsr fastlay ;<--DIRECT HIRES CALL lda PAGE eor #$20 sta PAGE ;& on other page jsr fastlay lda PAGE eor #$20 sta PAGE rts
    *-------------------------------** Draw big white post in Princess's room**-------------------------------DRAWPOST lda #postx sta XCO lda #posty sta YCO lda #postimg sta IMAGE lda #ora sta OPACITY jsr ]setch6 jmp addfore
    *-------------------------------** Draw hourglass in Princess's room** In: X = glass state (0-8, 0 = full)**-------------------------------DRAWGLASS lda #glassx sta XCO lda #glassy sta YCO lda glassimg,x sta IMAGE lda #sta sta OPACITY jsr ]setch6 jmp addback
    *-------------------------------** Mask princess's face & hair for certain CharPosns** (Called after ADDCHAROBJ)**-------------------------------PMASK ldx CharPosn cpx #19 ;plie bne :1 ldx #0 bpl :mask:1 cpx #1 ;pslump-1 beq :m1 cpx #18 ;pslump-2 bne :2:m1 ldx #1 bpl :mask:2
    ]rts rts
    :mask lda FCharY clc adc pmaskdy,x sta YCO
     lda XCO clc adc pmaskdx,x sta XCO
     lda pmaski,x sta IMAGE
     lda #5 ;chtable6 sta TABLE
     lda #and sta OPACITY lda #UseLayrsave.$80 jmp addmid
    *-------------------------------* If failed copy prot check due to disk not in drive, recheck* In: a = 0 (Call after setrecheck0)*-------------------------------RECHECKYEL sta tempblockx sta tempblocky jsr indexblock ;set y = 0 lda (locals),y ;All of this just to hide "lda recheck0"! beq ]rts ldx #5 jsr yellow lda #$ff rts
    *-------------------------------** Draw sand flowing through hourglass** In: X = frame # (0-3)*     Y = hourglass state (0-8)**-------------------------------FLOW cpy #8 bcs ]rts ;glass is empty jsr initlay lda #glassy sec sbc sandht,y sta BOTCUT lda flowimg,x sta IMAGE lda #flowx sta XCO lda #0 sta OFFSET lda #flowy sta YCO lda #sta sta OPACITY jsr ]setch6 jmp lay ;<---DIRECT HIRES CALL
    *-------------------------------* Save/restore FCharVars
    saveFChar ldx #$f:loop lda FCharVars,x sta tempsave,x dex bpl :loop rts
    restoreFChar ldx #$f:loop lda tempsave,x sta FCharVars,x dex bpl :loop]rts rts
    *-------------------------------** Draw "comix" star** In: Char data**-------------------------------SETUPCOMIX jsr saveFChar jsr :sub jmp restoreFChar
    :sub lda #$ff sta FCharIndex
    * Get y-coord
     lda CharPosn cmp #185 ;dead beq :low cmp #177 ;impaled beq :imp cmp #106 bcc :80 cmp #111 ;crouching bcc :low:80 cmp #178 ;halved beq ]rts
     lda #-15 ldx CharID beq :3 lda #-11 ;kid strikes lower than opponent:3 clc adc FCharY sta FCharY jmp :8
    :low lda #4 clc adc FCharY sta FCharY jmp :8
    * Get x-coord
    :imp lda #-5 impaled bne :9:8 lda #5:9 jsr addfcharx
    * Get color (kid red, opps blue)
     lda CharID beq :2 ;kid: 0 lda #1 ;opponents: 1:2 eor FCharX eor FCharFace and #1 ;look only at low bits bne :1 inc FCharX bne :1 inc FCharX+1:1 lda #starimage sta FCharImage lda #startable sta FCharTable
     lda #0 sta FCharCU sta FCharCL lda #40 sta FCharCR lda #192 sta FCharCD
     lda #TypeComix jmp addcharobj]rts rts
    *-------------------------------**  A D D   C H A R   O B J**  Add a character to object table**  In: FCharVars*      A = object type**-------------------------------ADDCHAROBJ ldx objX ;# objects already in list inx cpx #maxobj bcs ]rts ;list full (shouldn't happen) stx objX
     sta objTYP,x
     lda FCharX sta XCO lda FCharX+1 sta OFFSET
     txa pha jsr cvtx ;from 280-res to byte/offset pla tax
     lda XCO sta objX,x lda OFFSET sta objOFF,x
     lda FCharY sta objY,x
     lda FCharCU sta objCU,x lda FCharCL sta objCL,x lda FCharCR sta objCR,x lda FCharCD sta objCD,x
     lda FCharImage sta objIMG,x
     lda FCharTable sta objTAB,x
     lda FCharFace sta objFACE,x
     jmp SETOBJINDX
    *-------------------------------**  S E T  O B J  I N D X**  Set object index**-------------------------------SETOBJINDX lda FCharIndex sta objINDX,x
     cmp #30 bcs :os
     tax
     lda #1 sta objbuf,x:os rts
    *-------------------------------** Text routines** NOTE: These routines bypass normal data structures* & write directly to hi-res page.** Call at end of DRAWALL to make sure text goes on top* of everything else.**-------------------------------** Call once before using other text routines**-------------------------------pretext jsr initlay
     lda #bgtable2 sta TABLE lda #>bgtable2 sta TABLE+1 rts
    *-------------------------------* Part of "Yellow" copy-protection
    SETRECHECK0 lda #recheck0 sta locals lda #>recheck0 sta locals+1 ;fall thru (& return A = 0)
    *-------------------------------INITLAY lda #3 ;auxmem sta BANK
     lda #40 sta RIGHTCUT lda #192 sta BOTCUT ;use full screen lda #0 sta LEFTCUT sta TOPCUT rts
    *-------------------------------** Print character** In: PAGE, XCO/OFFSET, YCO*     a = ASCII value of character* Out: XCO/OFFSET (modified)**-------------------------------prchar sec sbc #"/" ;"0" = 1 sta IMAGE
     lda #ora sta OPACITY
     jsr lay
     inc XCO rts
    *------------------------------- lst ds 1 usr $a9,17,$00,*-org lst off

## Keyboard Shortcuts (see all)

### Site wide shortcuts

s
  Focus site search

?
  Bring up this help dialog

### Commit list

j
  Move selection down

k
  Move selection up

c or o or enter
  Open commit

y
  Expand URL to its canonical form

### Pull request list

j
  Move selection down

k
  Move selection up

o or enter
  Open issue

⌘ctrl + enter
  Submit comment

### Issues

j
  Move selection down

k
  Move selection up

x
  Toggle selection

o or enter
  Open issue

⌘ctrl + enter
  Submit comment

I
  Mark selection as read

U
  Mark selection as unread

y
  Remove selection from view

c
  Create issue

l
  Create label

i
  Back to inbox

u
  Back to issues

/
  Focus issues search

### Issues Dashboard

j
  Move selection down

k
  Move selection up

o or enter
  Open issue

### Network Graph

← or h
  Scroll left

→ or l
  Scroll right

↑ or k
  Scroll up

↓ or j
  Scroll down

t
  Toggle visibility of head labels

shift ← or shift h
  Scroll all the way left

shift → or shift l
  Scroll all the way right

shift ↑ or shift k
  Scroll all the way up

shift ↓ or shift j
  Scroll all the way down

### Source Code Browsing

t
  Activates the file finder

l
  Jump to line

w
  Switch branch/tag

y
  Expand URL to its canonical form

### Browsing Commits

⌘ctrl + enter
  Submit comment

escape
  Close form

## Markdown Cheat Sheet

### Format Text

Headers

    # This is an <h1> tag
    ## This is an <h2> tag
    ###### This is an <h6> tag

Text styles

    *This text will be italic*
    _This will also be italic_
    **This text will be bold**
    __This will also be bold__

    *You **can** combine them*

### Lists

Unordered

    * Item 1
    * Item 2
      * Item 2a
      * Item 2b

Ordered

    1. Item 1
    2. Item 2
    3. Item 3
       * Item 3a
       * Item 3b

### Miscellaneous

Images

    ![GitHub Logo](/images/logo.png)
    Format: ![Alt Text](url)

Links

    http://github.com - automatic!
    [GitHub](http://github.com)

Blockquotes

    As Kanye West said:

    > We're living the future so
    > the present is our past.

### Code Examples in Markdown

Syntax highlighting with GFM

    ```javascript
    function fancyAlert(arg) {
      if(arg) {
        $.facebox({div:'#foo'})
      }
    }
    ```

Or, indent your code 4 spaces

    Here is a Python code example
    without syntax highlighting:

        def foo:
          if not bar:
            return true

Inline code for comments

    I think you should use an
    `<addr>` element here instead.

Something went wrong with that request. Please try again. Dismiss

## Looking for the GitHub logo?

- #### GitHub Logo

  Download

- #### The Octocat

  Download