1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-26 22:31:14 +00:00
8bitworkshop/presets/astrocade/01-helloworlds.asm

36 lines
2.3 KiB
NASM
Raw Normal View History

2018-08-28 22:11:22 +00:00
; Demo 1: HELLO, WORLDS! / 2018 hxlnt
; Inspired by Adam Trionfo's Hello World
; http://www.ballyalley.com/ml/ml_homebrew/helloworld/hello.asm
; Assemble with Zmac 1.3
; From: https://github.com/hxlnt/astrocade
INCLUDE "hvglib.h" ; Include HVGLIB library
ORG FIRSTC ; Initialize at beginning of cartridge ROM area
DB $55 ; ... with the code for a normal menued cartridge
DW MENUST ; Initialize menu
DW PrgName ; ... with string at PrgName
DW PrgStart ; ... such that selecting the program enters PrgStart
PrgName: DB "HELLO, WORLDS!"; String
DB 0 ; ... which must be followed by 0
PrgStart: DI ; Disable interrupts
SYSTEM INTPC ; Begin interpreter mode
DO SETOUT ; Set output ports
DB 100*2 ; ... with VBLANK line set to line 100
DB 112/4 ; ... with color boundary 112 pixels from the left of the screen
DB 00001000b ; ... with screen interrupts reenabled
DO COLSET ; Set color palettes
DW Palettes ; ... with the values at Palettes
DO FILL ; Set background fill
DW NORMEM ; ... starting at the beginning of screen RAM
DW 100*BYTEPL ; ... and going for 100 lines
DB 00010010b ; ... with a fill pattern of three different colored pixels
DO STRDIS ; Set string display
DB 0 ; ... starting 0 pixels from the left of the screen
DB 32 ; ... and 32 pixels from the top of the screen
DB 00001100b ; ... with no enlargement, foreground color = 11, background color = 00
DW PrgName ; ... to show string at PrgName
2018-08-29 01:41:51 +00:00
EXIT ; Exit interpreter mode
2018-08-28 22:11:22 +00:00
Loop: JP Loop ; Play infinite loop
Palettes: DB $BF,$00,$00,$00 ; Left color palette (11b, 10b, 01b, 00b)
DB $E7,$9A,$39,$19 ; Right color palette (11b, 10b, 01b, 00b)