Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - My first program

Reply to topic
Author Message
  • Joined: 09 Apr 2021
  • Posts: 6
Reply with quote
My first program
Post Posted: Fri Apr 09, 2021 4:42 pm
New person here, slowly getting the hang of SMS development. I just wanted to share my first program here. Attached is the ROM + source code, which will assemble with SjASMPlus (google it, can't post a link because I'm a new member). Note that as of right now my VDP initialization code isn't working (need to figure out why) and I'm basically relying on the BIOS initializing the VDP in order to display anything.

Probably not using the best coding practices here, but I'd say it's a good start for my first proper program.
hello.zip (6.02 KB)

  View user's profile Send private message
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Fri Apr 09, 2021 6:05 pm
Welcome DevEd!

Hmm, I can't seem to get it working. Which BIOS does it require?

Is http://z00m128.github.io/sjasmplus/documentation.html the link you would have shared?

Btw. are you DevEd from the GameBoy community?
  View user's profile Send private message Visit poster's website
  • Joined: 09 Apr 2021
  • Posts: 6
Reply with quote
Post Posted: Fri Apr 09, 2021 6:25 pm
Calindro wrote
Hmm, I can't seem to get it working. Which BIOS does it require?

It should work with US/EU bios version 1.3.

Calindro wrote
Is (still can't post links) the link you would have shared?

I was going to link the Github repo, but more or less yes.

Calindro wrote
Btw. are you DevEd from the GameBoy community?

Yes.

EDIT: Just checked, unfortunately it seems it's completely broken in Emulicious. Definitely going to have to look into this...
  View user's profile Send private message
  • Joined: 14 Apr 2013
  • Posts: 623
Reply with quote
Post Posted: Fri Apr 09, 2021 6:45 pm
I just looked a bit into the issue.

Why do you do this?

    ; set up memory configuration
    ld        a,bMem_BIOSDisable | bMem_CardDisable | bMem_ExpansionDisable
    out        rMemCtrl,a

That's not necessary. The BIOS already examines all the slots and decides which one to enable. The BIOS also stores the value it last wrote there in RAM at $c000.
(and it's currently bugged)

In your SMS.inc you have the bit numbers defined

bMem_PadDisable            =    2    ; 0 = enable, 1 = disable
bMem_BIOSDisable        =    3    ; 0 = enable, 1 = disable
bMem_WRAMDisable        =    4    ; 0 = enable, 1 = disable
bMem_CardDisable        =    5    ; 0 = enable, 1 = disable
bMem_CartDisable        =    6    ; 0 = enable, 1 = disable
bMem_ExpansionDisable    =    7    ; 0 = enable, 1 = disable


so if you still want to use the lines above, it should look like

    ; set up memory configuration
    ld        a,(1 << bMem_BIOSDisable) | (1 << bMem_CardDisable) | (1 << bMem_ExpansionDisable)
    out        rMemCtrl,a


Btw. messaged you on Discord.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Apr 2021
  • Posts: 6
Reply with quote
Post Posted: Fri Apr 09, 2021 8:46 pm
Worked on this for a bit, and I think I've figured out how to get it working properly. Attached is the updated ROM + source.

EDIT: Updated w/ nicer font
hello.zip (6.09 KB)

  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!