Mercurial > hg > Members > kono > nitros9-code
comparison 3rdparty/p2mods/noice/noice.asm @ 1995:2bb2f8b975b0
additional preliminary changes made by R. Gault
author | boisy |
---|---|
date | Sun, 19 Feb 2006 15:09:42 +0000 |
parents | d5e3d4f5c45a |
children | abf447bacf71 |
comparison
equal
deleted
inserted
replaced
1994:45459aaf5d7d | 1995:2bb2f8b975b0 |
---|---|
46 atrv SET ReEnt+rev | 46 atrv SET ReEnt+rev |
47 rev SET $00 | 47 rev SET $00 |
48 edition SET 1 | 48 edition SET 1 |
49 | 49 |
50 * If an MPI is being used, set RS232SLOT to slot value - 1 and set MPI to 1 | 50 * If an MPI is being used, set RS232SLOT to slot value - 1 and set MPI to 1 |
51 MPICTRL EQU $FF7F | |
52 RS232SLOT EQU 1 slot 2 | |
53 | |
51 *MPI EQU 1 | 54 *MPI EQU 1 |
52 *RS232SLOT EQU 1 slot 2 | |
53 | 55 |
54 FN_ERROR EQU $F0 | 56 FN_ERROR EQU $F0 |
55 FN_SET_BYTES EQU $F9 | 57 FN_SET_BYTES EQU $F9 |
56 FN_RUN_TARGET EQU $FA | 58 FN_RUN_TARGET EQU $FA |
57 FN_WRITE_REGS EQU $FB | 59 FN_WRITE_REGS EQU $FB |
402 puls b,pc return | 404 puls b,pc return |
403 | 405 |
404 | 406 |
405 _readregs | 407 _readregs |
406 ldy callregs,u get pointer to caller's regs | 408 ldy callregs,u get pointer to caller's regs |
409 leax combuff+1,u | |
410 IFNE H6309 | |
411 ldb #21 get number of bytes to send | |
412 ELSE | |
407 ldb #16 get number of bytes to send | 413 ldb #16 get number of bytes to send |
408 stb combuff+1,u save number of bytes | 414 ENDC |
415 stb ,x+ save number of bytes | |
409 lda firsttime,u get first time called flag | 416 lda firsttime,u get first time called flag |
410 sta combuff+2,u write it | 417 sta ,x+ write it |
411 clr combuff+3,u clear page reg | 418 clr ,x+ clear page reg |
412 ldd R$U,y | 419 ldd R$U,y |
413 exg a,b | 420 exg a,b |
414 std combuff+6,u | 421 std ,x++ |
415 ldd R$Y,y | 422 ldd R$Y,y |
416 exg a,b | 423 exg a,b |
417 std combuff+8,u | 424 std ,x++ |
418 ldd R$X,y | 425 ldd R$X,y |
419 exg a,b | 426 exg a,b |
420 std combuff+10,u | 427 std ,x++ |
428 IFNE H6309 | |
429 ldd R$E,y | |
430 exg a,b | |
431 std ,x++ | |
432 ENDC | |
421 ldd R$A,y | 433 ldd R$A,y |
422 exg a,b | 434 exg a,b |
423 std combuff+12,u | 435 std ,x++ |
424 ldb R$DP,y | 436 ldb R$DP,y |
425 stb combuff+14,u DP | 437 stb ,x+ DP |
426 ldb R$CC,y | 438 ldb R$CC,y |
427 stb combuff+15,u CC | 439 stb ,x+ CC |
428 ldd R$PC,y | 440 ldd R$PC,y |
429 exg a,b | 441 exg a,b |
430 std combuff+16,u PC | 442 std ,x++ PC |
431 ldy <D.Proc get SP from proc desc | 443 ldy <D.Proc get SP from proc desc |
432 ldd P$SP,y | 444 ldd P$SP,y |
433 exg a,b | 445 exg a,b |
434 std combuff+4,u | 446 std combuff+4,u |
435 bsr _sendtohost | 447 bsr _sendtohost |
436 lbra mainloop | 448 lbra mainloop |
437 | 449 |
438 | 450 |
439 _writeregs | 451 _writeregs |
440 ldy callregs,u get caller's reg ptr | 452 ldy callregs,u get caller's reg ptr |
453 leax combuff+6,u | |
441 * lda D.Debug | 454 * lda D.Debug |
442 * anda #D_BRKPT | 455 * anda #D_BRKPT |
443 * sta <D.Debug | 456 * sta <D.Debug |
444 ldd combuff+6,u | 457 ldd ,x++ |
445 exg a,b | 458 exg a,b |
446 std R$U,y | 459 std R$U,y |
447 ldd combuff+8,u | 460 ldd ,x++ |
448 exg a,b | 461 exg a,b |
449 std R$Y,y | 462 std R$Y,y |
450 ldd combuff+10,u | 463 ldd ,x++ |
451 exg a,b | 464 exg a,b |
452 std R$X,y | 465 std R$X,y |
453 ldd combuff+12,u | 466 IFNE H6309 |
467 ldd ,x++ | |
468 exg a,b | |
469 std R$E,y | |
470 ENDC | |
471 ldd ,x++ | |
454 exg a,b | 472 exg a,b |
455 std R$A,y | 473 std R$A,y |
456 ldb combuff+14,u | 474 ldb ,x+ |
457 stb R$DP,y | 475 stb R$DP,y |
458 ldb combuff+15,u | 476 ldb ,x+ |
459 stb R$CC,y | 477 stb R$CC,y |
460 ldd combuff+16,u PC | 478 ldd ,x++ |
461 exg a,b | 479 exg a,b |
462 std R$PC,y | 480 std R$PC,y |
463 ldd combuff+4,u | 481 ldd combuff+4,u |
464 exg a,b | 482 exg a,b |
465 ldy <D.Proc | 483 ldy <D.Proc |
492 BAUD EQU _B9600 | 510 BAUD EQU _B9600 |
493 | 511 |
494 * llinit - Initialize the low-level I/O | 512 * llinit - Initialize the low-level I/O |
495 * Exit: Carry = 0: Init success; Carry = 1; Init failed | 513 * Exit: Carry = 0: Init success; Carry = 1; Init failed |
496 llinit | 514 llinit |
515 IFNE MPI | |
516 pshs a | |
517 lda MPICTRL | |
518 sta slot,u | |
519 lda #RS232SLOT | |
520 sta MPICTRL | |
521 puls a | |
522 ENDC | |
497 sta A_RESET soft reset (value not important) | 523 sta A_RESET soft reset (value not important) |
498 * Set specific modes and functions: | 524 * Set specific modes and functions: |
499 * - no parity, no echo, no Tx interrupt | 525 * - no parity, no echo, no Tx interrupt |
500 * - no Rx interrupt, enable Tx/Rx | 526 * - no Rx interrupt, enable Tx/Rx |
501 lda #$0B | 527 lda #$0B |
502 sta A_CMD save to command register | 528 sta A_CMD save to command register |
503 lda #BAUD | 529 lda #BAUD |
504 sta A_CTRL select proper baud rate | 530 sta A_CTRL select proper baud rate |
505 * Read any junk rx byte that may be in the register | 531 * Read any junk rx byte that may be in the register |
506 lda A_RXD | 532 lda A_RXD |
533 IFNE MPI | |
534 pshs a | |
535 lda slot,u | |
536 sta MPICTRL | |
537 puls a | |
538 ENDC | |
507 rts | 539 rts |
508 | 540 |
509 | 541 |
510 * llread - Read one character from 6551 | 542 * llread - Read one character from 6551 |
511 * | 543 * |
513 * Exit: A = character that was read | 545 * Exit: A = character that was read |
514 * | 546 * |
515 * Note, this routine currently doesn't timeout | 547 * Note, this routine currently doesn't timeout |
516 llread | 548 llread |
517 IFNE MPI | 549 IFNE MPI |
518 lda $FF7F | 550 lda MPICTRL |
519 sta slot,u | 551 sta slot,u |
520 lda #RS232SLOT | 552 lda #RS232SLOT |
521 sta $FF7F | 553 sta $FF7F |
522 ENDC | 554 ENDC |
523 r@ lda A_STATUS get status byte | 555 r@ lda A_STATUS get status byte |
525 beq r@ loop if rx buffer empty | 557 beq r@ loop if rx buffer empty |
526 lda A_RXD get byte from ACIA data port | 558 lda A_RXD get byte from ACIA data port |
527 IFNE MPI | 559 IFNE MPI |
528 pshs b | 560 pshs b |
529 ldb slot,u | 561 ldb slot,u |
530 stb $FF7F | 562 stb MPICTRL |
531 puls b,pc | 563 puls b,pc |
532 ELSE | 564 ELSE |
533 rts | 565 rts |
534 ENDC | 566 ENDC |
535 | 567 |
538 * Entry: A = character to write | 570 * Entry: A = character to write |
539 * Exit: None | 571 * Exit: None |
540 llwrite | 572 llwrite |
541 IFNE MPI | 573 IFNE MPI |
542 pshs d | 574 pshs d |
543 ldb $FF7F | 575 ldb MPICTRL |
544 stb slot,u | 576 stb slot,u |
545 ldb #RS232SLOT | 577 ldb #RS232SLOT |
546 stb $FF7F | 578 stb MPICTRL |
547 ELSE | 579 ELSE |
548 pshs a save byte to write | 580 pshs a save byte to write |
549 ENDC | 581 ENDC |
550 w@ lda A_STATUS get status byte | 582 w@ lda A_STATUS get status byte |
551 anda #$10 mask tx buffer status flag | 583 anda #$10 mask tx buffer status flag |
552 beq w@ loop if tx buffer full | 584 beq w@ loop if tx buffer full |
553 IFNE MPI | 585 IFNE MPI |
554 puls d get byte | 586 puls d get byte |
555 sta A_TXD save to ACIA data port | 587 sta A_TXD save to ACIA data port |
556 lda slot,u | 588 lda slot,u |
557 sta $FF7F | 589 sta MPICTRL |
558 ELSE | 590 ELSE |
559 puls a get byte | 591 puls a get byte |
560 sta A_TXD save to ACIA data port | 592 sta A_TXD save to ACIA data port |
561 ENDC | 593 ENDC |
562 rts | 594 rts |