NMS8245 2+ upgrade

Page 6/6
1 | 2 | 3 | 4 | 5 |

By Philip

Champion (369)

Philip's picture

04-04-2019, 21:36

The code at 7d8a is an interslot call to the subrom.
Below is my code which clearly shows NYYRIKKI is much better at this kind of stuff Smile

;
; Change bios to call the 'skip slot 1 or 2' in the subrom
;
  fpos	07d8ah
  rst	030h
  defb	083h		; It shouldn't hurt to hardcode the subrom slot
  defw	03f0eh		; Address of test_ab_key in subrom
  nop
  nop

Then this is the code in the subrom:

;
; Hold A or B key during boot to skip slot 1 or 2 respectively
;
  fpos	03f0eh

test_ab_key:
  push 	bc		; c has slot
  push 	af
  ld 	a,c
  and 	00000011b   	; remove subslot ( just skip all secundary slots)
  ld 	c,a

  ;FBE7 (keyboard row 2):
  ;A - bf - 1011 1111
  ;B - 7f - 0111 1111
  ld 	a,(newkey+2)
  xor 	255
  and 	11000000b       ; we are only interested in bit 7+6
  rla
  rla
  rla			; a should be 1 for 'A' and 2 for 'B' now
  cp 	c
  jr 	nz,test_ab_notpressed
  pop 	af
  ld 	c,a             ; save a register
  or 	1               ; reset z flag
  ld 	a,c             ; restore a register
  pop 	bc

  ret

test_ab_notpressed:
  pop 	af
  pop 	bc
  push	hl
  ld 	hl,04241h
  rst	020h            ; DCOMPR, compare HL with DE
  pop	hl
  ret                   ; ret z if 4142 is found

I use sjasmplus to assemble this. I just do incbin of the original rom then use fpos to overwrite the code on the correct place in the original rom.

Pentarou wrote:

Key "1" would conflict with Nextor, so I'd need to use other keys.

This is exactly the reason I chose A and B instead of 1 and 2.

NYYRIKKI wrote:

Ok... Smile In this case I'll give you another tip as well...

During early boot MSX checks that the upper 32KB of RAM does not have bit errors and there is indeed 32KB (and not ie. 8KB or 16KB) ... It actually does this two times!... As all MSX2+ machines have minimum of 64KB of memory this is utterly useless check. Even if you have failed RAM-chips in your machine, I've newer heard that this would have actually saved the day for anyone.... Only thing it can do is to move BASIC programs storage area up from #8000 and this way reduce RAM in use and probably only make the real problem even more hard to pin point.

Personally I changed it so that it checks only every 256th byte, but I see no reason why the check could not be removed completely if you want... This will save few seconds of boot time and will make the RETURN-check much more seamless (as you don't need to hold it down while MSX is doing these checks)

Thanks NYRRIKKI, this is a great tip! I will try to integrate this in my rom.

Also it would be nice to merge all this stuff with the msxnewbios project and put it on github.
And wasn't there another project similar to msxnewbios? I can't seem to find it a the moment.

By NYYRIKKI

Enlighted (5256)

NYYRIKKI's picture

04-04-2019, 21:49

Pentarou wrote:

Thanks for your help,

NYYRIKKI wrote:

Personally I changed it so that it checks only every 256th byte,

Could you tell me what BIOS function needs to be modded to achieve this? (name of the function or where is located?)

You can see these in #451 and #4B4

Quote:

But I don't understand how your code works Question

You got the disassembly correct, so I'll try to add some comments:

; NYYRIKKI's code disassembly
7fef cd8c01    call    018ch ; add a CALL to empty space before original INIT-routine

018c 79        ld      a,c
     e603      and     03h
     c8        ret     z ; In case of slot 0 return to normal INIT
     fe03      cp      03h
     c8        ret     z ; In case of slot 3 return to normal INIT
     c5        push    bc
     87        add     a,a ; Check bits 1 & 2
     47        ld      b,a
     af        xor     a ; ... on row 0
     cdec0b    call    0bech   ;Subroutine SNSMAT Returns the value of the specified line from the keyboard matrix
     f3        di
     a0        and     b ; compare the keyboard result to current slot number
     c1        pop     bc
     c0        ret     nz ; ... if not key down, return to normal INIT
     c1        pop     bc ; else pop the INIT address from stack (= do not execute INIT)
     c9        ret
Quote:

and Philip's code is also different but I don't understand where it does the magic:

 7d8c 0e3f      ld      c,3fh      ;address 03f -> You got this wrong way around... it is #3F0E

By NYYRIKKI

Enlighted (5256)

NYYRIKKI's picture

04-04-2019, 22:47

I only now realized that we practically answered at a same time. Smile

Philip wrote:
Pentarou wrote:

Key "1" would conflict with Nextor, so I'd need to use other keys.

This is exactly the reason I chose A and B instead of 1 and 2.

Please enlighten me... I know that in MSX tR "1"-key is used to force the machine in to MSX-DOS1 mode, but is this same implemented now in Nextor as well?

Quote:

Also it would be nice to merge all this stuff with the msxnewbios project and put it on github.
And wasn't there another project similar to msxnewbios? I can't seem to find it a the moment.

I must say I'm not familiar to msxnewbios project, but I've found msxsyssrc project quite priceless.

By Pentarou

Master (181)

Pentarou's picture

05-04-2019, 06:51

Thank you NYYRIKKI and Philip!! Running Naked in a Field of Flowers

Philip wrote:

Then this is the code in the subrom:

Hahaha you are right NYYRIKKI, I had the address in the SubROM wrong! Big smile

NYYRIKKI wrote:

Please enlighten me... I know that in MSX tR "1"-key is used to force the machine in to MSX-DOS1 mode, but is this same implemented now in Nextor as well?

Yes, from Konamiman's page:

Quote:

The Nextor kernel will boot in MSX-DOS 1 mode when the computer has no mapped RAM, when the "1" key is pressed at boot time, or when a MSX-DOS 1 boot sector is detected in the boot device.

By NYYRIKKI

Enlighted (5256)

NYYRIKKI's picture

05-04-2019, 09:13

Pentarou wrote:

Yes, from Konamiman's page:

Quote:

The Nextor kernel will boot in MSX-DOS 1 mode when the computer has no mapped RAM, when the "1" key is pressed at boot time, or when a MSX-DOS 1 boot sector is detected in the boot device.

Very nice, but indeed conflicts with my implementation... Unfortunately the "A" & "B" does not sound much better, since then it conflicts with MSXDOS2.SYS v2.40 (B-key is used to run AUTOEXEC.BAS instead of AUTOEXEC.BAT)

By tingis53

Paragon (1055)

tingis53's picture

23-04-2019, 17:03

Hello everybody
I've been following this thread being very interested on having a nms8250 or nms8280 upgraded to plus with the spanish keyboard layer , the boot logo and the reading of the ram present. As philip says on the first page of the thread there are some hardware modifications to do for the nms 8245 , my question is : NMS 8250 I asume needs some hard modifications but are they the same as for NMS 8245 or if there are any others to do , where can they be found ?
Thanks

Page 6/6
1 | 2 | 3 | 4 | 5 |
My MSX profile