Ack! It was a silly mistake. I needed JZ not RZ. Everything is working
perfectly now.

Stephen, off hand, do you know if there is any extra space left over
after your hardware scrolling patch? I'd like to use it, but I'm not
sure if it will fit anymore with the extra 11 bytes I added in the space
the base patch freed up.

Thanks again for your help with this!

On Sun, Nov 26, 2023 at 05:09:21AM -0500, Stephen Adolph wrote:
>    Both tests should modify carry flag?
> 
>    On Sunday, November 26, 2023, runrin <run....@rin.run> wrote:
> 
>      Here's the patch I wrote after applying your base patch. I must be
>      making a silly mistake here, since it doesn't seem to work correcly.
>      Semi-colon is no longer shifted as expected, but it's not catching
>      the
>      `o' for some reason.
> 
>                      .org    0722CH
>                      MOV     A,C     ; unchanged
>                      JMP     extra   ; go to patch   [C3 AB 75]
>      back(7230):     MVI     E,2CH   ; unchanged
>                      RET             ; unchanged
> 
>                      .org    075ABH
>      extra:          CPI 1BH         ; check for `o' [FE 1B]
>                      RZ              ;               [C8]
>                      CPI 19H         ; > 25 ?        [FE 19]
>                      RNC             ;               [D0]
>                      JMP back        ;               [C3 30 72]
> 
>      On Sat, Nov 25, 2023 at 04:48:40PM -0500, Stephen Adolph wrote:
>      >    here is a file "base_patch" that describes 4 changes to the
>      Main ROM to
>      >    create a hole from
>      >    75AB to 7640
>      >    which is free to use.
>      >
>      >    "... Base patch, which provides about 150 free bytes to use for
>      >    modifications to the M100 ROM.  The basis of this patch is the
>      >    observation that the PIO data table could be reduced from 240
>      bytes to
>      >    80 bytes.  This change forces a rewrite of a short section of a
>      >    routine."
>      >
>      >    Good luck with it; I used it to implement the hardware scroll
>      patch for
>      >    the M100.
>      >    The hardware scroll patch document has a section that details
>      how the
>      >    base patch works.
>      >    cheers
>      >    Steve
>      >
>      >    On Sat, Nov 25, 2023 at 1:05 PM runrin <run....@rin.run> wrote:
>      >
>      >      Wow, Stephen! Of course you know exactly where it is!
>      >
>      >      Thanks so much! If you could share your character printing
>      patch I'd
>      >      appreciate it.
>      >
>      >      Looks like the simplest way to get `o' to work with caps lock
>      would
>      >      be
>      >      to just accept that `;' and `[' will also be shifted, and
>      change the
>      >      27
>      >      to a 29.
>      >
>      >      It'll be fun to rewrite the routine though. It looks like
>      there are
>      >      5 or
>      >      6 bytes free at the end of the ROM, so being able to squeeze
>      the
>      >      patch
>      >      in there would be pretty nice.
>      >
>      >      On Sat, Nov 25, 2023 at 08:34:30AM -0500, Stephen Adolph
>      wrote:
>      >      >    Since you are modifying the ROM, you may find to get
>      what you
>      >      want you
>      >      >    need more space.
>      >      >
>      >      >    I have a patch that rewrites some routines for character
>      >      printing that
>      >      >    frees up about 180 bytes if I recall correctly.  I've
>      used this
>      >      to fix
>      >      >    things I don't like in the Main ROM.
>      >      >
>      >      >    I'm happy to share that patch, should your hacking
>      require some
>      >      bytes.
>      >      >
>      >      >    to your question.
>      >      >
>      >      >    722CH (79H) MOV A,C   Handle CAPS LOCK key during key
>      decoding
>      >      >    722DH (FEH) CPI 1AH
>      >      >    722FH (D0H) RNC
>      >      >    7230H (1EH) MVI E,2CH
>      >      >    7232H (C9H) RET
>      >      >
>      >      >    if the "regular key" is > 26 the key is not modified.
>      >      >    because the key # for o is 27, no upper case.
>      >      >
>      >      >    So you need a more complicated routine at 722Ch
>      >      >
>      >      >    On Sat, Nov 25, 2023 at 1:08 AM runrin <run....@rin.run>
>      wrote:
>      >      >
>      >      >      Hey all!
>      >      >
>      >      >      I just finished building my FlexROM and patching the
>      system
>      >      rom for
>      >      >      my
>      >      >      keyboard layout of choice (colemak). I'm super excited
>      about
>      >      it
>      >      >      because
>      >      >      it will make my m100 much more usable for me.
>      >      >
>      >      >      Here are the relevant lines of the rom that were
>      patched if
>      >      anyone
>      >      >      is
>      >      >      interested:
>      >      >
>      >      >      00007BF0   AA 7A 78 63  76 62 6B 6D  69 61 72 73  74
>      64 68 6E
>      >      >      .zxcvbkmiarstdhn
>      >      >      00007C00   65 71 77 66  70 67 6A 6C  75 79 3B 5B  6F
>      27 2C 2E
>      >      >      eqwfpgjluy;[o',.
>      >      >      00007C10   2F 31 32 33  34 35 36 37  38 39 30 2D  3D
>      5A 58 43
>      >      >      /1234567890-=ZXC
>      >      >      00007C20   56 42 4B 4D  49 41 52 53  54 44 48 4E  45
>      51 57 46
>      >      >      VBKMIARSTDHNEQWF
>      >      >      00007C30   50 47 4A 4C  55 59 3A 5D  4F 22 3C 3E  3F
>      21 40 23
>      >      >      PGJLUY:]O"<>?!@#
>      >      >      ...
>      >      >      00007CF0   00 00 00 D4  D2 D3 A6 A7  A8 6D 30 6E  31
>      65 32 69
>      >      >      .........m0n1e2i
>      >      >      00007D00   33 6C 34 75  35 79 36 01  06 14 02 20  7F
>      09 1B 8B
>      >      >      3l4u5y6.... ....
>      >      >
>      >      >      The last two lines makes the number pad work correctly
>      (an
>      >      extremely
>      >      >      easy fix!)
>      >      >
>      >      >      There is just one small bug with my patch, and that is
>      caps
>      >      lock not
>      >      >      working correctly. When caps lock is enabled, `o'
>      remains
>      >      lowercase
>      >      >      and
>      >      >      `;' types a `:'. I presume this is due to the way caps
>      lock
>      >      works
>      >      >      with
>      >      >      the keyboard matrix. The letter `o' has been moved out
>      of the
>      >      letter
>      >      >      rows of the keyboard matrix, and is now in one of the
>      symbol
>      >      >      rows. The opposite is true of the semi-colon, now
>      being part
>      >      of the
>      >      >      letter matrix replacing `p'.
>      >      >
>      >      >      Does anyone know if caps lock is done in software, or
>      if it's
>      >      >      modifying
>      >      >      which characters are being selected by pulling a bit
>      high or
>      >      >      something?
>      >      >
>      >      >      This is a really small issue, but I would like to get
>      it
>      >      working
>      >      >      correctly. I'll dive into the schematic when I have
>      some time
>      >      and
>      >      >      see if
>      >      >      I can find a hint about how caps lock works. If not
>      I'll
>      >      start
>      >      >      messing
>      >      >      around with Virtual-T and see what I can find there.
>      >      >
>      >      >      If I dig anything interesting up, I'll update this
>      thread
>      >      with what
>      >      >      I
>      >      >      learn.
> 
>      > ; patch #1 for M100/T102 rom
>      > ; this patch reduced the amount of space needed in the LCD
>      patterns table, enabling room for future changes
>      >
>      > ; blocks:
>      >
>      > ;             7467 - 746E checked
>      > ;             74BB - 74EA checked
>      > ;             7551 - 75AA checked
>      > ;             75AB - 763F hole created
>      >
>      >
>      >
>      >
>      > ;-----------------------------------------------------------
>      ---------------------------
>      >
>      > ;PATCH2
>      > ; Proposed replacement code 7467 to 746E
>      > ;checked
>      >
>      >       .org    07467H
>      >
>      > p2:   LXI     H,7643H
>      >       CALL    p5
>      >       NOP
>      >       NOP
>      >
>      >
>      > ;-----------------------------------------------------------
>      ---------------------------
>      > ;PATCH3
>      > ; Proposed replacement code 74BB to 74EA
>      > ; checked
>      >
>      >       .org    074BBH
>      >
>      > p3:   RLC
>      >       MOV C,A
>      >       MVI B,00H
>      >       LXI H,7551H
>      >       DAD B
>      >       MOV C,M
>      >       INX H
>      >       MOV A,M
>      >       PUSH PSW
>      >       LDA 0FFF4H
>      >       RAR
>      >       RAR
>      >       RAR
>      >       LXI H,7643H
>      >       CALL p5
>      >       CALL 753BH
>      >       SHLD 0FFF6H
>      >       POP PSW
>      >       ORA B
>      >       MOV B,A
>      >       POP H
>      >       DCR D
>      >       CALL 74F7H
>      >       INR D
>      >       MVI A,06H
>      >       SUB E
>      >       RZ
>      >       MOV E,A
>      >       PUSH H
>      >       LHLD 0FFF6H
>      >
>      >
>      > ;-----------------------------------------------------------
>      ---------------------------
>      > ;PATCH4
>      > ; this is the corrected LCD table  7551 to 75A0  240 bytes
>      > ; 75A1 to 7640 is free to use, 160 bytes total
>      > ; checked
>      >
>      >       .org    07551H  ; 80 bytes
>      > p4:   .db     00H,00H,00H,06H,00H,0CH,00H,
>      12H,00H,18H,00H,1EH,00H,24H,00H,2AH
>      >       .db     00H,30H
>      >       .db     02H,04H,02H,0AH,02H,10H,02H,
>      16H,02H,1CH,02H,22H,02H,28H,02H,2EH
>      >       .db     04H,02H,04H,08H,04H,0EH,04H,
>      14H,04H,1AH,04H,20H,04H,26H,04H,2CH
>      >       .db     06H,00H,06H,06H,06H,0CH,06H,
>      12H,06H,18H,06H,1EH,06H,24H,06H,2AH
>      >       .db     06H,30H
>      >       .db     08H,04H,08H,0AH,08H,10H,08H,16H,08H,1CH,08H,22H
>      >
>      >
>      >
>      >
>      > ;-----------------------------------------------------------
>      ---------------------------
>      > ;PATCH5
>      > ; Proposed subroutine at 75A1H to 75AA
>      > ; checked
>      >       .org    075A1H
>      >
>      > p5:   JNC ahead1
>      >       MVI L,4DH
>      > ahead1:       MVI B,00H
>      >       DAD B
>      >       MOV B,A
>      >       RET
>      >
>      >
>      > ; 75A1 to 75AA is used
>      > ; 75AB to 7640 free to use
>      >
>      > ;-----------------------------------------------------------
>      ---------------------------
>      >
>      >       .org    075ABh
>      >       .db     00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00,00,00,00,00,00,00,00
>      >       .db     00
>      >
>      > .end
>      >
>      >
>      >
>      >

Reply via email to