SEGANFREDORETRODEV

**** SEGANFREDO RETRODEV BASIC V2 ****

64K RAM SYSTEM  38911 BASIC BYTES FREE

 

READY.

LOAD "HENRIQUE",8,1

SEARCHING FOR HENRIQUE

LOADING

READY.

RUN

POWER

PLAYER 1 · READY

Hello, world.

I am Henrique Seganfredo, a retrocomputing enthusiast and retrogamer. This passion has paved my professional life, and below I present some of my personal hobby projects.

  1. 01 SegaNES NES emulator
  2. 02 NES-BASIC BASIC for the NES
  3. 03 Tucano A29 Master System shmup
01

NES · EMULATOR · JAVA + WEBASSEMBLY

SegaNES

SegaNES is a basic NES emulator I am writing from scratch in Java. It runs as a desktop app and, compiled to WebAssembly with TeaVM, right here in the browser. The 6502 CPU core passes the classic nestest test ROM, and the PPU renders scanline by scanline with scrolling, sprites, sprite-0 hit and nametable mirroring. That is enough for first-generation cartridges such as Mario Bros., Balloon Fight, Excitebike or Ice Climber. It also has save states, a configurable controller and Famicom Keyboard emulation.

Limitations: only mapper 0 (NROM) cartridges load, which leaves out most of the later NES library. There is no APU, so games run silent. It is a hobby emulator, so expect glitches in some titles. No ROMs are included: load your own .nes file.

D-pad
Arrow keys
A / B
Z / X
Select / Start
Shift / Enter
Save / Load
F5 / F8, Shift+1-9 / 1-9

Needs a recent browser with WebAssembly GC (current Chrome, Edge, Firefox or Safari). Click the screen before playing so it gets your keystrokes.

02

NES · BASIC INTERPRETER · C + 6502 ASM · WORK IN PROGRESS

NES-BASIC

NES-BASIC is a BASIC interpreter that runs on real NES hardware, written in C and 6502 assembly with cc65. It is not another Family BASIC: there is no keyboard entry of any kind, no on-screen editor or INPUT, and no Family Computer keyboard support. Instead, you write the program on a PC and the build process compiles it, together with its assets, into a static cartridge image that runs a tailored BASIC dialect as soon as the console boots.

The cartridge uses the MMC1 (SNROM) mapper with 256 KB of program ROM, and carries a small virtual filesystem for custom assets: tiles, palettes, screens, maps and text. Music and sound effects are composed in FamiStudio and played by its sound engine with PLAYBGM, PLAYSFX and PLAYSTOP. The graphics statements are geared toward RPG-style games: SPRITE and metasprites, MOVE, HUD, MENU, DIALOG boxes with a portrait and typewriter text, INTRO backdrops with palette cycling, SCREEN backgrounds and tile maps with actors, plus COLLIDE and MAPAT for collision checks.

The ROM below boots a built-in demo program, 15 screens that show off these capabilities one by one.

Still on the to-do list

  • Numbers are 16-bit integers only, with no floating point.
  • Tile maps are tiny (a fixed 4×4-tile layout), and map actors are not yet spawned as sprites or given collision automatically.
  • DIALOG boxes only draw their top and left borders.
  • Tight memory: 100 variables and a 3.6 KB pool shared by strings and arrays.
  • No end-user tooling yet. Building your own game still takes the full cc65 + PowerShell toolchain.

Runs in any emulator with MMC1 support (Mesen, FCEUX, Nestopia) or on a flash cart. It will not load in SegaNES above, which is NROM-only for now.

DEMO.BAS · screen 11
3710 PRINT "SCREEN 11/15: MENU TEST"
3730 PRINT "PICK ONE (D-PAD+A, B CANCELS):"
3740 DATA "START GAME", "OPTIONS", "QUIT"
3750 MENU PICK, 3740
3770 IF PICK = -1 THEN PRINT "CANCELLED"
3780 IF PICK > 0 THEN PRINT "CHOSE OPTION "; PICK
3800 PAUSE 2

REM screen 9: move a sprite with the D-pad
3170 SPRITE 0, 0, 32, CX, CY, 0
3180 MOVE CX, CY, STICK(0), 4, 0, 240, 8, 216
3190 SPRITE 0, 0, 32, CX, CY, 0
3200 IF STRIG(0) AND 1 THEN 3300
3210 GOTO 3180

REM screen 7: music and sound
2110 PLAYBGM "FAREWELL.BGM"
03

SEGA MASTER SYSTEM · VERTICAL SHMUP · C (SDCC / Z80)

Tucano A29

Tucano A29 is a vertical-scrolling shoot-'em-up for the Sega Master System. You fly a turboprop light-attack plane low over the Amazon, fighting both air and ground targets in the spirit of Xevious and Twin Cobra. It is written in C for the Z80 and built on romdev, the fantastic retro development toolkit by Luis Montes, which bundles the compiler, emulator and SMS runtime that made this project possible.

Status: only one level is ready. Stage 1, the Amazon river at dawn, is about two minutes of river with AA guns, trucks, boats, helicopters, jets and gold dredges to loot. It ends in a fight against a fortified river barge. After the boss, a repair shop lets you spend your cash on lives, bombs and gun upgrades. Stage 2 currently replays the stage 1 map. The game already has a title screen, an attract-mode demo, continues, high score and an original soundtrack, all on a 128 KB cartridge.

A nice touch is the FM soundtrack. At boot the game checks for the Yamaha YM2413 FM chip of the Japanese Master System and the Mark III FM Sound Unit. When it is there, every song plays in a richer FM arrangement built from the same notes, with melody, harmony, two pads, a deeper bass line and the chip's rhythm-mode drums. Every other console gets the original PSG versions, and the options menu lets you switch FM sound on or off (or shows it as not available).

Move
D-pad
Button 1
Machine guns
Button 2
Bombs

Play it in any Master System emulator (Emulicious, Kega Fusion, Mesen, or RetroArch with Genesis Plus GX) or on real hardware with a flash cart. To hear the FM music, turn on the emulator's FM / YM2413 sound option (in Genesis Plus GX it is the "YM2413" core option).