c64gs.inc
1: zFB = $fb
2: zFC = $fc
3:
4: L0E00 := $0e00
5:
6:
7: sec
8: .byte ASM_BIT2
9:
10: C64GS_Init:
11: clc
12: ror zFB
13: php
14: sei
15:
16: lda #VICII_B_ControlReg1_RSEL + 3
17: sta VIC + VICII_O_ControlReg1
18:
19: lda #$17
20: sta VIC + VICII_O_MemControl
21:
22: ldx #0
23:
24: @ClearLoop:
25: lda #0
26: sta COLORRAM,x
27: sta COLORRAM + $100,x
28: sta COLORRAM + $200,x
29: sta COLORRAM + $300,x
30:
31: lda #' '
32: sta lVIDEORAM,x
33: sta lVIDEORAM + $100,x
34: sta lVIDEORAM + $200,x
35: sta lVIDEORAM + $300,x
36:
37: inx
38: bne @ClearLoop
39:
40: lda #<(lVIDEORAM + 83)
41: sta zFC
42: lda #>(lVIDEORAM + 83)
43: sta zFC + 1
44:
45: ldx #$15
46: @OuterLoop:
47: ldy #$21
48: lda #$A0
49: @SpaceLoop:
50: sta (zFC),y
51: dey
52: bne @SpaceLoop
53:
54: clc
55: lda zFC
56: adc #40
57: sta zFC
58: bcc :+
59: inc zFC + 1
60: :
61: dex
62: bne @OuterLoop
63:
64: lda #' '
65: sta lVIDEORAM + 2 * 40 + 36
66: sta lVIDEORAM + 22 * 40 + 4
67:
68: lda #14
69: ldx #31
70: @ColorLoop:
71: sta COLORRAM + 2 * 40 + 4,x
72: sta COLORRAM + 3 * 40 + 4,x
73: sta COLORRAM + 4 * 40 + 4,x
74: sta COLORRAM + 20 * 40 + 4,x
75: sta COLORRAM + 21 * 40 + 4,x
76: dex
77: bpl @ColorLoop
78:
79: ldx #<(COLORRAM + 5 * 40 + 4)
80: stx zFC
81: ldx #>(COLORRAM + 5 * 40 + 4)
82: stx zFC + 1
83:
84: ldx #$0f
85: @ColorSetLoop:
86: lda #$0e
87: ldy #0
88: sta (zFC),y
89: ldy #31
90: sta (zFC),y
91:
92: clc
93: lda zFC
94: adc #40
95: sta zFC
96: bcc :+
97: inc zFC + 1
98: :
99: dex
100: bne @ColorSetLoop
101:
102: bit zFB
103: bpl GS_ExtraHandling
104:
105: lda #VICII_B_ControlReg1_DEN + VICII_B_ControlReg1_RSEL + 3
106: sta VIC + VICII_O_ControlReg1
107:
108: plp
109: rts
110:
111:
112: GS_ExtraHandling:
113: ldx #$00
114:
115: @Loop:
116: lda GS_Data,X
117: beq LF7D9
118: sta lVIDEORAM + 129,x
119: inx
120: bpl @Loop
121: ldx #7
122:
123: LF7D9:
124: lda LF8E5,x
125: sta lVIDEORAM + $3F8,x
126: dex
127: bpl LF7D9
128:
129:
130: ldx #$3f
131: :
132: lda LF90D,x
133: sta L0E00,x
134:
135: lda LF94D,x
136: sta L0E00 + $40,x
137:
138: lda LF98D,x
139: sta L0E00 + $80,x
140:
141: lda LF9CD,x
142: sta L0E00 + $C0,x
143:
144: lda LFA0D,x
145: sta L0E00 + $100,x
146:
147: lda LFA4D,x
148: sta L0E00 + $140,x
149:
150: lda LFA8D,x
151: sta L0E00 + $180,x
152:
153: dex
154: bpl :-
155:
156:
157: lda #$04
158: sta VIC + VICII_O_SprMCM
159:
160: lda #$73
161: sta VIC + VICII_O_SprExpandX
162:
163: LF81B:
164:
165: ldx #$3f
166: :
167: lda LFACD,x
168: sta L0E00 + $1C0,x
169:
170: dex
171: bpl :-
172:
173:
174: ldx #$0f
175: :
176: lda LF8ED,x
177: sta VIC + VICII_O_SprBackColl,x
178: lda LF8FD,x
179: sta VIC,x
180: dex
181: bpl :-
182:
183: lda #VICII_B_ControlReg1_DEN + VICII_B_ControlReg1_RSEL + 3
184: sta VIC + VICII_O_ControlReg1
185:
186: lda #$BE
187: sta VIC + VICII_O_SprEnable
188: jsr LF89F
189:
190: lda #$FC
191: sta VIC + VICII_O_SprEnable
192: jsr LF8AB
193:
194: lda #$BD
195: sta VIC + VICII_O_SprEnable
196: jsr LF8A8
197:
198: lda #$3D
199: sta VIC + VICII_O_SprEnable
200: jsr LF8A8
201:
202: LF85C:
203: inc VIC + VICII_O_Sprite3Y
204: jsr LF8AE
205:
206: ldx VIC + VICII_O_Sprite3Y
207: cpx #$7c
208: bcc LF85C
209:
210: jsr LF8A8
211:
212:
213: ldx #$3f
214: :
215: lda LFB0D,x
216: sta L0E00 + $1C0,x
217:
218: dex
219: bpl :-
220:
221: lda #$05
222: sta VIC + VICII_O_Spr7Col
223:
224: lda #$7C
225: sta VIC + VICII_O_SprEnable
226: jsr LF8AB
227:
228: lda #$3E
229: sta VIC + VICII_O_SprEnable
230: jsr LF8A8
231:
232: lda #$BE
233: sta VIC + VICII_O_SprEnable
234: jsr LF89F
235:
236: lda #$04
237: sta VIC + VICII_O_SprEnable
238: jsr LF8A8
239:
240: jmp LF81B
241:
242: LF89F:
243: jsr LF8A8
244: jsr LF8A8
245: jsr LF8A8
246:
247: LF8A8:
248: ldy #40
249: .byte ASM_BIT3
250:
251: LF8AB:
252: ldy #$06
253: .byte ASM_BIT3
254:
255: LF8AE:
256: ldy #$02
257:
258: :
259: jsr LF8BF
260: dey
261: bne :-
262:
263: jsr CheckCartridge
264: beq LF8BC
265: rts
266:
267:
268: LF8BC:
269: jmp ($FFFC)
270:
271: LF8BF:
272: bit VIC + VICII_O_ControlReg1
273: bmi LF8BF
274: :
275: bit VIC + VICII_O_ControlReg1
276: bpl :-
277: rts
278:
279: GS_Data:
280: .byte $c3, $8f, $8d, $8d, $8f, $84, $8f, $92
281: .byte $85, $a0, $c3, $b6, $b4, $a0, $c7, $81
282: .byte $8d, $85, $93, $a0, $d3, $99, $93, $94
283: .byte $85, $8d, $00
284:
285: LF8E5:
286: .byte $38, $39, $3a, $3b, $3c, $3d, $3e, $3f
287:
288: LF8ED:
289: .byte $00, $06, $06, $01, $02, $03, $06, $01
290: .byte $0f, $0f, $0a, $0f, $0f, $0f, $0f, $02
291:
292: LF8FD:
293: .byte $e0, $7e, $e0, $7e, $43, $43, $94, $64
294: .byte $90, $82, $60, $82, $e0, $7e, $ac, $a7
295:
296: LF90D:
297: .byte $80, $00, $00
298: .byte $80, $00, $00
299: .byte $ff, $c0, $00
300: .byte $c0, $40, $00
301: .byte $c0, $40, $00
302: .byte $c0, $40, $00
303: .byte $c0, $c0, $00
304: .byte $c1, $80, $00
305: .byte $c3, $00, $00
306: .byte $c6, $00, $60
307: .byte $cc, $00, $90
308: .byte $c8, $00, $90
309: .byte $c8, $40, $90
310: .byte $c8, $80, $90
311: .byte $c9, $f8, $60
312: .byte $c8, $80, $00
313: .byte $c8, $46, $77
314: .byte $d8, $09, $44
315: .byte $f0, $09, $66
316: .byte $80, $09, $44
317: .byte $80, $06, $44
318: .byte $00
319: LF94D:
320:
321: .byte $80, $00, $40
322: .byte $80, $00, $40
323: .byte $f0, $00, $40
324: .byte $d8, $40, $40
325: .byte $c8, $80, $40
326: .byte $c9, $f8, $40
327: .byte $c8, $80, $00
328: .byte $c8, $43, $24
329: .byte $c8, $04, $b4
330: .byte $c8, $04, $ac
331: .byte $c8, $04, $a4
332: .byte $cc, $03, $24
333: .byte $c6, $00, $00
334: .byte $c3, $00, $00
335: .byte $c1, $80, $00
336: .byte $c0, $80, $00
337: .byte $c0, $80, $00
338: .byte $c0, $80, $00
339: .byte $ff, $80, $00
340: .byte $80, $00, $00
341: .byte $80, $00, $00
342: .byte $00
343: LF98D:
344:
345: .byte $00, $00, $00
346: .byte $00, $00, $00
347: .byte $00, $00, $00
348: .byte $01, $54, $00
349: .byte $05, $54, $00
350: .byte $05, $54, $00
351: .byte $15, $54, $00
352: .byte $15, $02, $a8
353: .byte $14, $02, $a0
354: .byte $14, $02, $80
355: .byte $14, $00, $00
356: .byte $14, $03, $c0
357: .byte $14, $03, $f0
358: .byte $15, $03, $fc
359: .byte $15, $54, $00
360: .byte $05, $54, $00
361: .byte $05, $54, $00
362: .byte $01, $54, $00
363: .byte $00, $00, $00
364: .byte $00, $00, $00
365: .byte $00, $00, $00
366: .byte $00
367:
368: LF9CD:
369:
370: .byte $1f, $ff, $e0
371: .byte $30, $00, $a0
372: .byte $3f, $ff, $a0
373: .byte $3f, $ff, $a0
374: .byte $20, $00, $a0
375: .byte $20, $00, $a0
376: .byte $20, $00, $a0
377: .byte $3f, $ff, $a0
378: .byte $3f, $ff, $a0
379: .byte $3f, $ff, $a0
380: .byte $3f, $ff, $a0
381: .byte $3f, $ff, $c0
382: .byte $3f, $ff, $80
383: .byte $00, $00, $00
384: .byte $00, $60, $00
385: .byte $00, $60, $00
386: .byte $00, $60, $00
387: .byte $03, $6c, $00
388: .byte $01, $f8, $00
389: .byte $00, $f0, $00
390: .byte $00, $60, $00
391: .byte $00
392:
393: LFA0D:
394:
395: .byte $00, $00, $00
396: .byte $00, $00, $00
397: .byte $bf, $ff, $7c
398: .byte $bf, $ff, $7d
399: .byte $7f, $fe, $f9
400: .byte $60, $06, $fb
401: .byte $df, $ed, $f3
402: .byte $80, $1d, $f6
403: .byte $ff, $fb, $e6
404: .byte $ff, $fb, $ec
405: .byte $ff, $f7, $cc
406: .byte $ff, $f7, $d8
407: .byte $ff, $ef, $98
408: .byte $ff, $ef, $b0
409: .byte $ff, $df, $30
410: .byte $00, $00, $60
411: .byte $ff, $ff, $60
412: .byte $ff, $ff, $c0
413: .byte $ff, $ff, $c0
414: .byte $00, $00, $00
415: .byte $00, $00, $00
416: .byte $00
417:
418: LFA4D:
419:
420: .byte $00, $00, $00
421: .byte $00, $00, $00
422: .byte $03, $ff, $ff
423: .byte $03, $ff, $ff
424: .byte $07, $ff, $ff
425: .byte $07, $ff, $ff
426: .byte $0f, $ff, $fe
427: .byte $0f, $ff, $fe
428: .byte $1f, $ff, $fd
429: .byte $1f, $ff, $fd
430: .byte $3f, $ff, $fb
431: .byte $3f, $ff, $fb
432: .byte $7f, $ff, $f7
433: .byte $7f, $ff, $f7
434: .byte $ff, $ff, $ef
435: .byte $80, $00, $00
436: .byte $ff, $ff, $ff
437: .byte $ff, $ff, $ff
438: .byte $ff, $ff, $ff
439: .byte $00, $00, $00
440: .byte $00, $00, $00
441: .byte $00
442:
443: LFA8D:
444:
445: .byte $80, $00, $00
446: .byte $80, $00, $00
447: .byte $fe, $00, $00
448: .byte $c1, $00, $00
449: .byte $c1, $00, $00
450: .byte $c2, $00, $00
451: .byte $c2, $00, $00
452: .byte $c4, $00, $00
453: .byte $c4, $00, $00
454: .byte $c8, $00, $00
455: .byte $c8, $00, $00
456: .byte $c8, $00, $00
457: .byte $c4, $00, $00
458: .byte $c4, $00, $00
459: .byte $c2, $00, $00
460: .byte $c2, $00, $00
461: .byte $c1, $00, $00
462: .byte $c1, $00, $00
463: .byte $fe, $00, $00
464: .byte $80, $00, $00
465: .byte $80, $00, $00
466: .byte $00
467:
468: LFACD:
469:
470: .byte $00, $00, $00
471: .byte $e0, $00, $38
472: .byte $f0, $00, $78
473: .byte $78, $00, $f0
474: .byte $3c, $01, $e0
475: .byte $1e, $03, $c0
476: .byte $0f, $07, $80
477: .byte $07, $8f, $00
478: .byte $03, $de, $00
479: .byte $01, $fc, $00
480: .byte $00, $f8, $00
481: .byte $00, $f8, $00
482: .byte $01, $fc, $00
483: .byte $03, $de, $00
484: .byte $07, $8f, $00
485: .byte $0f, $07, $80
486: .byte $1e, $03, $c0
487: .byte $3c, $01, $e0
488: .byte $78, $00, $f0
489: .byte $f0, $00, $78
490: .byte $e0, $00, $38
491: .byte $00
492:
493: LFB0D:
494:
495: .byte $00, $00, $00
496: .byte $00, $00, $38
497: .byte $00, $00, $78
498: .byte $00, $00, $f0
499: .byte $00, $01, $e0
500: .byte $00, $03, $c0
501: .byte $00, $07, $80
502: .byte $00, $0f, $00
503: .byte $00, $1e, $00
504: .byte $00, $3c, $00
505: .byte $60, $78, $00
506: .byte $e0, $f0, $00
507: .byte $e1, $e0, $00
508: .byte $e3, $c0, $00
509: .byte $e7, $80, $00
510: .byte $ef, $00, $00
511: .byte $fe, $00, $00
512: .byte $fc, $00, $00
513: .byte $f8, $00, $00
514: .byte $f0, $00, $00
515: .byte $e0, $00, $00
516: .byte $00
517:
518: TapeIrqRead:
519: TapeIrqWrite:
520: TapeIrqWritePreamble:
521: TapeWriteCompleteFile:
522: TapeReadFileContents:
523: TapePressRecordAndPlayOnTape:
524: TapeReadTapeHeaderOfNextFile:
525: TapeFindSpecificFile:
526: TapePressPlayOnTape:
527: TapeCreateFileBuffer:
528: TapeGetPointer:
529: TapeWriteCompleteBuffer:
530: TapeReadNextBuffer:
531: TAPE_INCREMENT_WRITE_POINTER:
532:
533: jmp KErrDeviceNotPresent
534:
535:
536: .segment "KERNAL_GS_8E"
537:
538: Copy_zSTAL_to_zSAL:
539: lda zSTAL + 1
540: sta zSAL + 1
541: lda zSTAL
542: sta zSAL
543: rts
544:
545:
546:
547: .segment "KERNAL_GS_00"
548: .byte "COPYRIGHT 1990 COMMODORE ELECTRONICS LTD. ALL RIGHTS RESERVED."
549:
550:
551: .segment "KERNAL_GS_54"
552: TapeIrqEnd2:
553: jmp NMI_End
554:
555:
556:
557:
558: .segment "KERNAL_GS_93"
559:

c64gs.inc.html; generated on Fri Sep 18 21:44:54 2015 by ca65html
uz@cc65.org