Toshiba HX-23F wiki

Page 2/3
1 | | 3

By gdx

Prophet (2977)

gdx's picture

12-05-2017, 15:30

To found the RAM you need respect theses conditions:

  1. If a disk is installed then read slot values for each bank at addresses F341h to F344h.
  2. If not disk installed, read bits 7 & 6 at port a8h and if 0FCC4h = &H80 then read reversed bits 7 & 6 of FFFFh address to know the RAM slot value on bank 3.
  3. For other banks (0~2) you need to program a routine that seeks RAM in each slot in the order of 0-0 to 0-3, 1-0 to 1-3, 2-0 to 2-3 and 3-0 to 3-3 by holding account of addresses 0FCC1h to 0FCC3h to avoid looking in the secondary slots when there is none.

Search for RAM at 0000h, 4000h and 8000h and replace the old values after the test.
Do not forget that there is a register for secondary slots in each primary slot. So we must select the corresponding primary slot in the bank 3 to select the secondary slot on any bank.

By Eugeny_Brychkov

Paragon (1088)

Eugeny_Brychkov's picture

12-05-2017, 16:24

Great advice, thank you. I would to your item 2 checking of the BOTTOM to be 0C000h or below.
It seems I do all of these now, except first step.

By gdx

Prophet (2977)

gdx's picture

13-05-2017, 00:38

I think you have understood the principle but I still correct the errors.

  1. If a disk is installed then read slot values for each bank at addresses F341h to F344h.
  2. If not disk installed, read bits 7 & 6 at port a8h to get primary slot value and if 0FCCxh = &H80 (x=primary slot value) then read reversed bits 7 & 6 of FFFFh address to know the RAM slot value on bank 3.
  3. Read bits 5 & 4 at port a8h to get primary slot value and if 0FCCxh = &H80 then read reversed bits 7 & 6 of FFFFh address to know the RAM slot value on bank 2. Check if RAM is here.
  4. For other banks (0~1) you need to program a routine that seeks RAM in each slot in the order of 0-0 to 0-3, 1-0 to 1-3, 2-0 to 2-3 and 3-0 to 3-3 by holding account of addresses 0FCC1h to 0FCC4h to avoid looking in the secondary slots when there is none.

The first step is important for the turbo R.

By Grauw

Ascended (8382)

Grauw's picture

13-05-2017, 00:28

No need to page in and read FFFFH, the values are mirrored in RAM (SLTTBL). This way you can avoid some of the more complicated bits of slot selection (subslot selection). Also I would just use BIOS RDSLT / WRSLT. Then you don't need to worry about your code being in the same page as the RAM you're detecting.

By gdx

Prophet (2977)

gdx's picture

13-05-2017, 00:38

Thanks Grauw, this simplifies step 2 and 3.

By sd_snatcher

Prophet (3047)

sd_snatcher's picture

13-05-2017, 04:56

Quote:

Let's return to considering wording as they bugged me. Do we still think that software which can not handle such configurations is "poorly written" and "buggy"? I would say these are kind of strongly negative statements. I would write differently, that "software may not assume and thus support these configurations".

Eugeny, don't take it personal. It's a technical article, so it must be objective and concise. It's like saying to someone that a tire in their car is flat. The driver shouldn't take it as an offense.

Sugarcoating the problem will just make users confused on wether the problem in in their hardware or in the software that they're trying to run. For quite some time this uncertainty has even lead users to butcher perfectly valid MSX designs just to "fix" them to be able to this or that game, when the game is what should be fixed.

Nobody has to know everything. Yes, there was a mistake in your code, and that means nothing negative about your skills. It was just a lack of information. But with that warning in the article, you were sure where the problem was, and had the guts to learn a solution and improve your MSX programming skills even more. Smile

By gdx

Prophet (2977)

gdx's picture

13-05-2017, 10:30

SLTTBL seems to be only a backup of secondary slot registers when slots are scanned during the system boot (Basic environment) but it seems usable.

(Correction for step 2 & 3: x = primary slot value + 1)

By Eugeny_Brychkov

Paragon (1088)

Eugeny_Brychkov's picture

13-05-2017, 11:35

sd_snatcher][quote wrote:

Let's return to considering wording as they bugged me.

I agree with you on all of these. Sometimes programmers, including me, take shortcuts in order to simplify design and increase speed of development, not considering possible cases outside of configuration assumptions. IMHO most of the times because programmer simply does not know about these cases...

The aim is not to demotivate developers, and educate them, positively.

By Louthrax

Prophet (2076)

Louthrax's picture

13-05-2017, 12:23

Let the MSX coder that never made a slot-programing can cast the first stone to Eugeny (and that definitively won't be me Smile).

By Manuel

Ascended (15686)

Manuel's picture

13-05-2017, 13:09

I keep wondering why no one stood up and created a repository of commonly needed subroutines (like RAM search) that everyone can use. I might be tempted to start coding for MSX if such a library would exist, because I personally hate to reinvent the wheel... Such routines are so often needed, that the should be a commonality that you don't need to waste time on to write them again...

Page 2/3
1 | | 3